/*
 * HPanel design system v3
 *
 * The visual language is derived from the CRM prospect workspace, then expanded
 * into a fresh product shell: confident type, generous rounded geometry, soft
 * layered surfaces, one electric-blue action accent and purposeful data density.
 * Page code consumes semantic --hp-* tokens; --ds-* exists only as a temporary
 * compatibility bridge for legacy HPanel renderers.
 */
:root {
  --hp-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hp-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* Primitives. Keep page code on semantic tokens below. */
  --hp-neutral-0: #ffffff;
  --hp-neutral-25: #fdfdfe;
  --hp-neutral-50: #f8f9fb;
  --hp-neutral-75: #f3f5f8;
  --hp-neutral-100: #edf0f4;
  --hp-neutral-150: #e5e9ef;
  --hp-neutral-200: #dce1e9;
  --hp-neutral-300: #cbd2dc;
  --hp-neutral-400: #9ba4b2;
  --hp-neutral-500: #707988;
  --hp-neutral-600: #535c69;
  --hp-neutral-700: #353c47;
  --hp-neutral-800: #222832;
  --hp-neutral-900: #11151c;
  --hp-blue-50: #eef4ff;
  --hp-blue-100: #dce8ff;
  --hp-blue-300: #93b3fb;
  --hp-blue-500: #356df3;
  --hp-blue-600: #275bd7;
  --hp-blue-700: #214bb1;

  /* Semantic color roles. */
  --hp-canvas: #f3f6fb;
  --hp-canvas-subtle: #f8fafd;
  --hp-surface: var(--hp-neutral-0);
  --hp-surface-raised: var(--hp-neutral-0);
  --hp-surface-sunken: #eef2f7;
  --hp-surface-hover: #f6f8fb;
  --hp-surface-active: var(--hp-blue-50);
  --hp-border-subtle: #e8ecf2;
  --hp-border: var(--hp-neutral-200);
  --hp-border-strong: var(--hp-neutral-300);
  --hp-text: var(--hp-neutral-900);
  --hp-text-secondary: #3c4451;
  --hp-text-muted: #697382;
  --hp-text-faint: #98a1af;
  --hp-accent: var(--hp-blue-500);
  --hp-accent-hover: var(--hp-blue-600);
  --hp-accent-pressed: var(--hp-blue-700);
  --hp-accent-soft: var(--hp-blue-50);
  --hp-accent-border: #c7d8ff;
  --hp-success: #287956;
  --hp-success-soft: #edf7f1;
  --hp-success-border: #cde8da;
  --hp-warning: #9b641c;
  --hp-warning-soft: #fff7e9;
  --hp-warning-border: #f0ddb8;
  --hp-danger: #b64248;
  --hp-danger-soft: #fff1f2;
  --hp-danger-border: #f1cdd0;
  --hp-info: #3d7696;
  --hp-info-soft: #edf6fa;
  --hp-info-border: #cfe3ed;

  --hp-sidebar: #151a27;
  --hp-sidebar-hover: #202737;
  --hp-sidebar-active: #293247;
  --hp-sidebar-text: #aeb5c3;
  --hp-sidebar-muted: #747f91;
  --hp-sidebar-border: rgba(255,255,255,.07);

  --hp-space-0-5: 2px;
  --hp-space-1: 4px;
  --hp-space-1-5: 6px;
  --hp-space-2: 8px;
  --hp-space-2-5: 10px;
  --hp-space-3: 12px;
  --hp-space-4: 16px;
  --hp-space-5: 20px;
  --hp-space-6: 24px;
  --hp-space-8: 32px;

  --hp-font-2xs: 10px;
  --hp-font-xs: 11px;
  --hp-font-sm: 12px;
  --hp-font-md: 13px;
  --hp-font-base: 14px;
  --hp-font-lg: 16px;
  --hp-font-xl: 20px;
  --hp-font-2xl: 26px;
  --hp-font-3xl: 32px;
  --hp-leading-tight: 1.25;
  --hp-leading-normal: 1.45;
  --hp-leading-relaxed: 1.6;
  --hp-weight-regular: 400;
  --hp-weight-medium: 500;
  --hp-weight-semibold: 600;
  --hp-weight-strong: 680;

  --hp-radius-xs: 6px;
  --hp-radius-sm: 9px;
  --hp-radius-md: 12px;
  --hp-radius-lg: 16px;
  --hp-radius-xl: 22px;
  --hp-radius-2xl: 28px;
  --hp-radius-pill: 999px;
  --hp-shadow-xs: 0 1px 2px rgba(24,35,52,.04), 0 4px 14px rgba(24,35,52,.035);
  --hp-shadow-sm: 0 12px 34px -14px rgba(24,35,52,.2), 0 2px 8px rgba(24,35,52,.04);
  --hp-shadow-md: 0 24px 54px -22px rgba(24,35,52,.28), 0 6px 18px rgba(24,35,52,.06);
  --hp-shadow-popover: 0 24px 64px -18px rgba(17,25,40,.3), 0 4px 12px rgba(17,25,40,.06);
  --hp-shadow-drawer: -28px 0 72px -24px rgba(14,22,36,.36);
  --hp-control-sm: 36px;
  --hp-control-md: 42px;
  --hp-control-lg: 48px;
  --hp-button-height-xs: 30px;
  --hp-button-height-sm: 36px;
  --hp-button-height-md: 42px;
  --hp-button-height-lg: 48px;
  --hp-button-radius-sm: 10px;
  --hp-button-radius-md: 12px;
  --hp-button-padding-sm: 11px;
  --hp-button-padding-md: 16px;
  --hp-button-icon-sm: 14px;
  --hp-button-icon-md: 15px;
  --hp-header-height: 68px;
  --hp-sidebar-width: 240px;
  --hp-transition-fast: 120ms ease;
  --hp-transition: 180ms ease;

  /* Compatibility aliases for legacy HPanel views. */
  --ds-primary: var(--hp-accent);
  --ds-primary-hover: var(--hp-accent-hover);
  --ds-primary-dark: var(--hp-accent-pressed);
  --ds-primary-light: var(--hp-accent-soft);
  --ds-primary-50: var(--hp-accent-soft);
  --ds-primary-100: var(--hp-blue-100);
  --ds-success: var(--hp-success);
  --ds-success-light: var(--hp-success-soft);
  --ds-warning: var(--hp-warning);
  --ds-warning-light: var(--hp-warning-soft);
  --ds-danger: var(--hp-danger);
  --ds-danger-light: var(--hp-danger-soft);
  --ds-info: var(--hp-info);
  --ds-accent: var(--hp-accent);
  --ds-gray-50: var(--hp-neutral-50);
  --ds-gray-100: var(--hp-neutral-100);
  --ds-gray-200: var(--hp-border);
  --ds-gray-300: var(--hp-border-strong);
  --ds-gray-400: var(--hp-text-faint);
  --ds-gray-500: var(--hp-text-muted);
  --ds-gray-600: var(--hp-neutral-600);
  --ds-gray-700: var(--hp-neutral-700);
  --ds-gray-800: var(--hp-neutral-800);
  --ds-gray-900: var(--hp-text);
  --ds-white: var(--hp-surface);
  --ds-sidebar-bg: var(--hp-sidebar);
  --ds-sidebar-hover: var(--hp-sidebar-hover);
  --ds-sidebar-text: var(--hp-sidebar-text);
  --ds-radius-sm: var(--hp-radius-sm);
  --ds-radius-md: var(--hp-radius-md);
  --ds-radius-lg: var(--hp-radius-lg);
  --ds-radius-xl: var(--hp-radius-xl);
  --ds-font: var(--hp-font-sans);
  --ds-shadow-card: var(--hp-shadow-xs);
  --ds-shadow-elevated: var(--hp-shadow-sm);
}

body {
  font-family: var(--hp-font-sans);
  color: var(--hp-text);
  background: var(--hp-canvas);
  font-size: var(--hp-font-base);
  line-height: var(--hp-leading-normal);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--hp-blue-100); color: var(--hp-text); }
svg.lucide { width: 16px; height: 16px; stroke-width: 1.75; }

button, input, select, textarea { font: inherit; }
button { letter-spacing: inherit; }
code { border-radius: var(--hp-radius-xs); background: var(--hp-surface-sunken); color: var(--hp-text-secondary); font-family: var(--hp-font-mono); font-size: var(--hp-font-sm); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid rgba(47,111,237,.28);
  outline-offset: 2px;
}

.sa-app { background: radial-gradient(circle at 22% -18%,rgba(83,126,243,.09),transparent 30%),var(--hp-canvas); }
.sa-sidebar { width: var(--hp-sidebar-width); background: linear-gradient(180deg,#171d2b 0%,var(--hp-sidebar) 48%,#111621 100%); border-right: 1px solid rgba(0,0,0,.14); box-shadow: 10px 0 34px rgba(17,24,39,.08); }
.sa-sidebar-logo { padding: 20px 16px 0; }
.sa-sidebar-logo-inner { padding: 0 2px 20px; border-color: var(--hp-sidebar-border); }
.sa-sidebar-logo-icon { width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(145deg,#7592ff 0%,#4966dc 55%,#374ab2 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.26),0 8px 18px rgba(45,67,154,.32); }
.sa-sidebar-logo h2 { font-size: 15px; font-weight: var(--hp-weight-strong); letter-spacing: -.025em; }
.sa-sidebar-logo span { color: var(--hp-sidebar-muted); font-size: var(--hp-font-2xs); letter-spacing: .09em; }
.sa-nav { padding: 14px 12px 18px; gap: 4px; }
.sa-nav-label { padding: 14px 12px 6px; color: var(--hp-sidebar-muted); font-size: var(--hp-font-2xs); letter-spacing: .1em; }
.sa-nav-item { min-height: 42px; padding: 10px 12px; gap: 10px; border: 1px solid transparent; border-radius: var(--hp-radius-md); font-size: var(--hp-font-sm); font-weight: var(--hp-weight-medium); color: var(--hp-sidebar-text); transition: background var(--hp-transition-fast),border-color var(--hp-transition-fast),color var(--hp-transition-fast),transform var(--hp-transition-fast); }
.sa-nav-item:hover { background: var(--hp-sidebar-hover); color: #e7eaf0; }
.sa-nav-item.active { border-color: rgba(133,158,255,.16); background: linear-gradient(135deg,rgba(103,128,232,.3),rgba(66,82,132,.34)); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.07),0 8px 20px rgba(7,12,22,.18); }
.sa-nav-item :is(i,svg) { width: 17px; height: 17px; flex: 0 0 auto; }
.sa-nav-badge { min-width: 17px; height: 17px; padding: 0 5px; background: var(--hp-danger); font-size: var(--hp-font-2xs); font-weight: var(--hp-weight-semibold); box-shadow: 0 0 0 2px var(--hp-sidebar); }
.sa-nav-item.active .sa-nav-badge { box-shadow: 0 0 0 2px var(--hp-sidebar-active); }
.sa-nav-divider { background: var(--hp-sidebar-border); }
.sa-main { min-width: 0; }
.sa-header { min-height: var(--hp-header-height); padding: 12px 32px; border-color: rgba(220,225,233,.82); background: rgba(255,255,255,.84); box-shadow: 0 1px 0 rgba(255,255,255,.82); backdrop-filter: blur(18px) saturate(150%); }
.sa-header h1 { font-size: var(--hp-font-xl); font-weight: var(--hp-weight-strong); letter-spacing: -.03em; }
.sa-header h1:empty { display: none; }
.sa-header-user { gap: 12px; color: var(--hp-text-muted); font-size: var(--hp-font-sm); }
.sa-header-user > .btn-secondary { min-height: var(--hp-control-sm); }
.hpanel-activities-trigger :is(i,svg) { width: 16px; height: 16px; }
.sa-content { padding: 28px 32px 36px; }

.btn-gradient,
.btn-gradient-success,
.btn-gradient-danger,
.btn-secondary,
.btn-ghost {
  min-height: var(--hp-control-md);
  padding: 0 16px;
  border-radius: var(--hp-radius-md);
  font-size: var(--hp-font-md);
  font-weight: var(--hp-weight-semibold);
  line-height: 1;
  transition: background var(--hp-transition), border-color var(--hp-transition), color var(--hp-transition), box-shadow var(--hp-transition), transform var(--hp-transition);
  transform: none;
}
.btn-gradient { border: 1px solid #2f66e7; background: linear-gradient(180deg,#477cf5 0%,var(--hp-accent) 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.2),0 8px 18px -8px rgba(53,109,243,.72); }
.btn-gradient:hover { border-color: var(--hp-accent-hover); background: linear-gradient(180deg,#3d72e9 0%,var(--hp-accent-hover) 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.18),0 12px 24px -10px rgba(39,91,215,.75); transform: translateY(-1px); }
.btn-gradient:active { border-color: var(--hp-accent-pressed); background: var(--hp-accent-pressed); }
.btn-gradient-success { background: var(--hp-success); border: 1px solid var(--hp-success); box-shadow: none; }
.btn-gradient-danger { background: var(--hp-danger); border: 1px solid var(--hp-danger); box-shadow: none; }
.btn-secondary { border-color: var(--hp-border); background: rgba(255,255,255,.92); color: var(--hp-text-secondary); box-shadow: var(--hp-shadow-xs); }
.btn-secondary:hover { border-color: var(--hp-border-strong); background: var(--hp-surface); color: var(--hp-text); box-shadow: var(--hp-shadow-sm); transform: translateY(-1px); }
.btn-ghost:hover { background: var(--hp-surface-hover); color: var(--hp-text); }
.btn-sm { min-height: var(--hp-control-sm); padding: 0 11px; border-radius: var(--hp-radius-sm); font-size: var(--hp-font-sm); }
.btn-gradient:disabled, .btn-gradient-success:disabled, .btn-gradient-danger:disabled, .btn-secondary:disabled, .btn-ghost:disabled { opacity: .46; cursor: not-allowed; box-shadow: none; }
.btn-gradient :is(i,svg), .btn-gradient-success :is(i,svg), .btn-gradient-danger :is(i,svg), .btn-secondary :is(i,svg), .btn-ghost :is(i,svg) { width: 14px; height: 14px; flex: 0 0 auto; }

.sa-card, .sa-modal, .crm-card { border-color: rgba(215,222,232,.92); border-radius: var(--hp-radius-lg); box-shadow: var(--hp-shadow-xs); }
.sa-modal-overlay { z-index: 10100; }
.sa-toast { z-index: 10200; }
.sa-card { margin-bottom: 20px; background: rgba(255,255,255,.96); }
.sa-card-header { min-height: 56px; padding: 14px 18px; border-color: var(--hp-border-subtle); }
.sa-card-header h3 { color: var(--hp-text); font-size: var(--hp-font-lg); font-weight: var(--hp-weight-strong); letter-spacing: -.02em; }
.sa-table { font-variant-numeric: tabular-nums; }
.sa-table th { height: 46px; padding: 11px 16px; background: #f8fafd; color: var(--hp-text-muted); border-bottom: 1px solid var(--hp-border); font-size: var(--hp-font-2xs); font-weight: var(--hp-weight-semibold); letter-spacing: .06em; }
.sa-table td { min-height: 52px; padding: 13px 16px; color: var(--hp-text-secondary); border-bottom-color: var(--hp-border-subtle); font-size: var(--hp-font-md); line-height: 1.42; }
.sa-table td strong { color: var(--hp-text); font-weight: var(--hp-weight-semibold); }
.sa-table tbody tr:hover { background: var(--hp-surface-hover); }
.sa-table tbody tr:last-child td { border-bottom: 0; }
.sa-badge { min-height: 24px; padding: 3px 9px; border: 1px solid transparent; border-radius: var(--hp-radius-pill); font-size: var(--hp-font-xs); font-weight: var(--hp-weight-semibold); letter-spacing: 0; }
.sa-badge-green { background: var(--hp-success-soft); color: var(--hp-success); }
.sa-badge-blue { background: var(--hp-accent-soft); color: var(--hp-accent-pressed); }
.sa-badge-yellow { background: var(--hp-warning-soft); color: var(--hp-warning); }
.sa-badge-red { background: var(--hp-danger-soft); color: var(--hp-danger); }
.sa-badge-gray { background: var(--hp-surface-sunken); color: var(--hp-text-muted); }
.sa-badge-purple { background: #f1eff9; color: #6650a7; }
.sa-tabs { min-height: 52px; padding: 0 18px; gap: 26px; border-bottom: 1px solid var(--hp-border); background: var(--hp-surface); }
.sa-tab { position: relative; min-height: 52px; padding: 0; margin: 0; border: 0; color: var(--hp-text-muted); display: inline-flex; align-items: center; font-size: var(--hp-font-md); font-weight: var(--hp-weight-medium); }
.sa-tab:hover { color: var(--hp-text-secondary); }
.sa-tab.active { color: var(--hp-text); border: 0; font-weight: var(--hp-weight-semibold); }
.sa-tab.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; border-radius: var(--hp-radius-pill) var(--hp-radius-pill) 0 0; background: var(--hp-accent); }
.sa-filters { gap: 10px; margin-bottom: 16px; }
.sa-filters input[type="text"] { width: min(320px,100%); min-width: 200px; max-width: none; height: var(--hp-control-md); padding: 0 12px; border-color: var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface); color: var(--hp-text); font-size: var(--hp-font-md); box-shadow: none; }
.sa-filters input[type="text"]::placeholder { color: var(--hp-text-faint); }
.sa-filters input[type="text"]:focus { border-color: var(--hp-blue-300); background: var(--hp-surface); box-shadow: 0 0 0 3px rgba(47,111,237,.08); }
.sa-dropdown-btn { min-height: var(--hp-control-md); padding: 0 11px; border-color: var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface); color: var(--hp-text-secondary); font-size: var(--hp-font-md); box-shadow: none; }
.sa-dropdown-btn:hover { border-color: var(--hp-border-strong); background: var(--hp-surface-hover); color: var(--hp-text); }
.sa-dropdown-btn.open { border-color: var(--hp-blue-300); background: var(--hp-surface); box-shadow: 0 0 0 3px rgba(47,111,237,.08); }
.sa-dropdown-menu { margin-top: 2px; padding: 4px; border-color: var(--hp-border); border-radius: var(--hp-radius-md); box-shadow: var(--hp-shadow-popover); }
.sa-dropdown-item { min-height: 32px; padding: 7px 9px; border-radius: var(--hp-radius-sm); color: var(--hp-text-secondary); font-size: var(--hp-font-md); }
.sa-dropdown-item:hover { background: var(--hp-surface-hover); color: var(--hp-text); }
.sa-dropdown-item.active { background: var(--hp-accent-soft); color: var(--hp-accent-pressed); }
.form-group label { color: var(--hp-text-secondary); font-size: 11px; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea, .sa-dropdown-btn {
  border-color: var(--hp-border);
  border-radius: var(--hp-radius-md);
  color: var(--hp-text);
  box-shadow: none;
}

/* Shared content primitives */
.sa-stats { gap: 12px; margin-bottom: 18px; }
.sa-stat { position: relative; min-width: 0; overflow: hidden; padding: 18px 20px; border-color: rgba(215,222,232,.92); border-radius: var(--hp-radius-lg); background: linear-gradient(145deg,#fff 0%,#fbfcff 100%); box-shadow: var(--hp-shadow-xs); }
.sa-stat::after { content: ""; position: absolute; top: -28px; right: -24px; width: 80px; height: 80px; border-radius: 50%; background: rgba(53,109,243,.055); pointer-events: none; }
.sa-stat:hover { border-color: var(--hp-accent-border); box-shadow: var(--hp-shadow-sm); }
.sa-stat-label { margin-bottom: 3px; color: var(--hp-text-muted); font-size: var(--hp-font-xs); font-weight: var(--hp-weight-medium); }
.sa-stat-value { color: var(--hp-text); font-size: var(--hp-font-2xl); font-weight: var(--hp-weight-strong); letter-spacing: -.035em; }
.sa-stat-sub { margin-top: 3px; color: var(--hp-text-faint); font-size: var(--hp-font-xs); }

.sa-feature, .sa-feature-entitlement { border-color: var(--hp-border-subtle); border-radius: var(--hp-radius-md); background: linear-gradient(145deg,#fff,#fbfcfe); }
.sa-feature { min-height: 48px; padding: 10px 12px; }
.sa-feature:hover, .sa-feature-entitlement:hover { border-color: var(--hp-border-strong); }
.sa-feature-name { color: var(--hp-text-secondary); font-size: var(--hp-font-md); font-weight: var(--hp-weight-medium); }
.sa-feature-group, .sa-feature-group-heading { color: var(--hp-text-muted); font-size: var(--hp-font-2xs); }
.sa-feature-entitlement { padding: 13px 14px; }
.sa-feature-entitlement.off { background: var(--hp-canvas-subtle); opacity: .7; }
.sa-feature-entitlement-icon { width: 38px; height: 38px; border-radius: var(--hp-radius-md); background: var(--hp-accent-soft); color: var(--hp-accent); }
.sa-feature-entitlement-title { color: var(--hp-text); font-size: var(--hp-font-md); font-weight: var(--hp-weight-semibold); }
.sa-feature-entitlement-desc { color: var(--hp-text-muted); font-size: var(--hp-font-sm); }

.sa-toggle { width: 36px; height: 20px; }
.sa-toggle-slider { border: 1px solid var(--hp-border-strong); background: var(--hp-neutral-100); }
.sa-toggle-slider::before { width: 14px; height: 14px; bottom: 2px; left: 2px; box-shadow: 0 1px 2px rgba(16,17,20,.15); }
.sa-toggle input:checked + .sa-toggle-slider { border-color: var(--hp-accent); background: var(--hp-accent); }
.sa-toggle input:checked + .sa-toggle-slider::before { transform: translateX(16px); }
input[type="checkbox"].sa-check-input { width: 16px; height: 16px; border: 1px solid var(--hp-border-strong); border-radius: var(--hp-radius-xs); }
input[type="checkbox"].sa-check-input:checked { border-color: var(--hp-accent); background: var(--hp-accent); }
input[type="checkbox"].sa-check-input:checked::after { left: 5px; top: 2px; width: 4px; height: 8px; border-width: 0 1.5px 1.5px 0; }

.sa-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.sa-card textarea,
.sa-card select,
.sa-modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.sa-modal textarea,
.sa-modal select {
  min-height: var(--hp-control-md);
  padding: 8px 11px;
  border-color: var(--hp-border);
  border-radius: var(--hp-radius-md);
  background: var(--hp-surface);
  color: var(--hp-text);
  font-size: var(--hp-font-md);
  box-shadow: none;
}
.sa-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.sa-card textarea:focus,
.sa-card select:focus,
.sa-modal input:focus,
.sa-modal textarea:focus,
.sa-modal select:focus { border-color: var(--hp-blue-300); box-shadow: 0 0 0 3px rgba(47,111,237,.08); }
.sa-card .form-group > label, .sa-modal label, .form-group label { margin-bottom: 5px; color: var(--hp-text-secondary); font-size: var(--hp-font-sm); font-weight: var(--hp-weight-semibold); }

.sa-alert { min-height: 48px; padding: 12px 14px; gap: 10px; border-color: var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface); color: var(--hp-text-secondary); font-size: var(--hp-font-md); line-height: 1.45; }
.sa-alert-info { border-color: var(--hp-info-border); background: var(--hp-info-soft); color: #28566f; box-shadow: inset 3px 0 0 var(--hp-info); }
.sa-alert-warn { border-color: var(--hp-warning-border); background: var(--hp-warning-soft); color: #6f4918; box-shadow: inset 3px 0 0 var(--hp-warning); }
.sa-alert-danger { border-color: var(--hp-danger-border); background: var(--hp-danger-soft); color: #7f3439; box-shadow: inset 3px 0 0 var(--hp-danger); }
.sa-alert :is(i,svg) { width: 15px; height: 15px; }
.sa-table-group-row td { padding: 7px 14px !important; background: var(--hp-surface-sunken); color: var(--hp-text-muted); font-size: var(--hp-font-2xs); font-weight: var(--hp-weight-semibold); }

.sa-detail-header { min-height: 56px; margin-bottom: 18px; gap: 12px; }
.sa-detail-header .sa-back { width: 40px; height: 40px; padding: 0; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface); color: var(--hp-text-muted); box-shadow: var(--hp-shadow-xs); display: inline-flex; align-items: center; justify-content: center; }
.sa-detail-header .sa-back:hover { border-color: var(--hp-border-strong); background: var(--hp-surface-hover); color: var(--hp-text); }
.sa-detail-header .sa-back :is(i,svg) { width: 15px; height: 15px; }
.sa-detail-header h2 { color: var(--hp-text); font-size: var(--hp-font-2xl); font-weight: var(--hp-weight-strong); letter-spacing: -.035em; }
.sa-info-grid { margin-bottom: 20px; gap: 0; overflow: hidden; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-lg); background: var(--hp-surface); box-shadow: var(--hp-shadow-xs); }
.sa-info-item { min-height: 62px; padding: 12px 14px; border-right: 1px solid var(--hp-border-subtle); border-bottom: 1px solid var(--hp-border-subtle); }
.sa-info-item label { margin-bottom: 4px; color: var(--hp-text-muted); font-size: var(--hp-font-2xs); font-weight: var(--hp-weight-medium); letter-spacing: .045em; }
.sa-info-item .val { color: var(--hp-text); font-size: var(--hp-font-md); font-weight: var(--hp-weight-medium); }
.sa-totals { gap: 5px; padding: 14px 16px; border-top: 1px solid var(--hp-border-subtle); color: var(--hp-text-secondary); font-size: var(--hp-font-md); }
.sa-totals .total-label { color: var(--hp-text-muted); }
.sa-totals .total-value { color: var(--hp-text); font-weight: var(--hp-weight-semibold); }
.sa-totals .grand-total { color: var(--hp-text); font-size: var(--hp-font-lg); }

.sa-modal-overlay { background: rgba(17,24,39,.48); backdrop-filter: blur(8px) saturate(110%); }
.sa-modal { padding: 28px; border: 1px solid rgba(255,255,255,.72); border-radius: var(--hp-radius-xl); box-shadow: var(--hp-shadow-popover); }
/* Keep the long Client Setup form inside the phone viewport. */
.sa-modal.client-setup-dialog { width: min(720px, calc(100vw - 32px)); max-width: 100%; min-width: 0; }
.client-setup-dialog input:not([type="checkbox"]):not([type="radio"]):not([data-hx-select]),
.client-setup-dialog .hx-select-btn, .client-setup-dialog .hx-select-opt,
.client-setup-dialog .btn-secondary, .client-setup-dialog .btn-gradient { min-height: 44px; }
.client-setup-dialog .hx-select-opt { display: flex; align-items: center; overflow-wrap: anywhere; }
.sa-modal h2 { margin-bottom: 20px; color: var(--hp-text); font-size: var(--hp-font-2xl); font-weight: var(--hp-weight-strong); letter-spacing: -.035em; }
.sa-modal .form-group { margin-bottom: 14px; }
.sa-modal-actions { gap: 8px; margin-top: 18px; }
.sa-toast { right: 20px; bottom: 20px; padding: 11px 14px; border: 1px solid rgba(255,255,255,.22); border-radius: var(--hp-radius-md); font-size: var(--hp-font-md); font-weight: var(--hp-weight-semibold); box-shadow: var(--hp-shadow-sm); }
.sa-toast.success { background: var(--hp-success); }
.sa-toast.error { background: var(--hp-danger); }

.sa-pipeline { gap: 6px; margin-bottom: 12px; }
.sa-pipeline-chip { min-height: 32px; padding: 0 10px; border-color: var(--hp-border); border-radius: var(--hp-radius-pill); color: var(--hp-text-muted); font-size: var(--hp-font-sm); font-weight: var(--hp-weight-medium); }
.sa-pipeline-chip:hover { border-color: var(--hp-border-strong); color: var(--hp-text); }
.sa-pipeline-chip.active { border-color: var(--hp-accent); background: var(--hp-accent); color: #fff; }
.sa-note { padding: 12px 14px; border-color: var(--hp-border-subtle); border-radius: var(--hp-radius-md); background: var(--hp-canvas-subtle); }
.sa-note-meta { color: var(--hp-text-muted); font-size: var(--hp-font-xs); }
.sa-note-content { color: var(--hp-text-secondary); font-size: var(--hp-font-md); line-height: var(--hp-leading-relaxed); }

/* Header activity center */
.hpanel-activities-trigger { width: 40px; height: 40px; border-color: var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface); color: var(--hp-text-muted); box-shadow: var(--hp-shadow-xs); }
.hpanel-activities-trigger:hover, .hpanel-activities-trigger.open { border-color: var(--hp-accent-border); background: var(--hp-accent-soft); color: var(--hp-accent); }
.hpanel-activities-badge { background: var(--hp-danger); font-weight: var(--hp-weight-semibold); }
.hpanel-activities-popover { border-color: var(--hp-border); border-radius: var(--hp-radius-xl); box-shadow: var(--hp-shadow-popover); }
.hpanel-activities-head { border-color: var(--hp-border-subtle); }
.hpanel-activities-summary { border-color: var(--hp-border-subtle); background: var(--hp-canvas-subtle); }
.hpanel-activities-chip { border-color: var(--hp-border); background: var(--hp-surface); color: var(--hp-text-secondary); font-size: var(--hp-font-xs); font-weight: var(--hp-weight-semibold); }
.hpanel-activity-row { border-color: var(--hp-border-subtle); }
.hpanel-activity-row:hover { background: var(--hp-surface-hover); }
.hpanel-activity-done, .hpanel-activity-refresh { border-color: var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface); }
.hpanel-activity-edit { color: var(--hp-text-muted); }
.next-activity-type { min-height: 40px; border-color: var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface); color: var(--hp-text-secondary); font-size: var(--hp-font-sm); font-weight: var(--hp-weight-semibold); }
.next-activity-type:hover { border-color: var(--hp-accent-border); background: var(--hp-accent-soft); color: var(--hp-accent); }
.next-activity-type.active { border-color: var(--hp-accent); background: var(--hp-accent-soft); color: var(--hp-accent-pressed); box-shadow: 0 0 0 2px rgba(47,111,237,.08); }

/* Login uses the same product scale as the authenticated shell. */
.sa-login { background: var(--hp-sidebar); }
.sa-login-card { width: 420px; padding: 40px; border: 1px solid rgba(255,255,255,.14); border-radius: var(--hp-radius-xl); box-shadow: 0 34px 90px rgba(0,0,0,.34); }
.sa-login-card h1 { margin-bottom: 5px; color: var(--hp-text); font-size: var(--hp-font-2xl); font-weight: var(--hp-weight-strong); letter-spacing: -.025em; }
.sa-login-card p { margin-bottom: 24px; color: var(--hp-text-muted); font-size: var(--hp-font-md); }
.sa-login-card .form-group { margin-bottom: 14px; }
.sa-login-card label { margin-bottom: 5px; color: var(--hp-text-secondary); font-size: var(--hp-font-sm); font-weight: var(--hp-weight-semibold); }
.sa-login-card input { min-height: var(--hp-control-lg); padding: 0 12px; border-color: var(--hp-border); border-radius: var(--hp-radius-md); color: var(--hp-text); font-size: var(--hp-font-base); }
.sa-login-card input:focus { border-color: var(--hp-blue-300); box-shadow: 0 0 0 3px rgba(47,111,237,.09); }
.sa-login-card .btn-gradient { min-height: var(--hp-control-lg); margin-top: 6px; padding: 0 14px; font-size: var(--hp-font-base); }

/* Page families */
.sa-app[data-page="dashboard"] .dash-hero { gap: 14px; margin-bottom: 16px; }
.sa-app[data-page="dashboard"] .dash-hero-card { position: relative; min-height: 148px; overflow: hidden; padding: 20px 22px; border: 1px solid rgba(214,222,234,.94); border-radius: var(--hp-radius-lg); background: linear-gradient(145deg,#fff 0%,#f9fbff 100%); box-shadow: var(--hp-shadow-xs); }
.sa-app[data-page="dashboard"] .dash-hero-card::after { display: block; content: ""; position: absolute; top: -52px; right: -44px; width: 148px; height: 148px; border-radius: 50%; background: radial-gradient(circle,rgba(53,109,243,.12),rgba(53,109,243,0) 70%); pointer-events: none; }
.sa-app[data-page="dashboard"] .dash-hero-card:hover { border-color: var(--hp-accent-border); box-shadow: var(--hp-shadow-sm); transform: translateY(-2px); }
.sa-app[data-page="dashboard"] .dash-hero-icon { width: 40px; height: 40px; margin-bottom: 16px; border-radius: 14px; background: linear-gradient(145deg,#f2f6ff,#e6eeff) !important; color: var(--hp-accent) !important; box-shadow: inset 0 0 0 1px rgba(53,109,243,.08); }
.sa-app[data-page="dashboard"] .dash-hero-icon :is(i,svg) { width: 18px !important; height: 18px !important; color: var(--hp-accent) !important; }
.sa-app[data-page="dashboard"] .dash-hero-value { color: var(--hp-text); font-size: var(--hp-font-3xl); font-weight: var(--hp-weight-strong); letter-spacing: -.045em; }
.sa-app[data-page="dashboard"] .dash-hero-label { margin-top: 4px; color: var(--hp-text-muted); font-size: var(--hp-font-sm); font-weight: var(--hp-weight-medium); }
.sa-app[data-page="dashboard"] .dash-mini { gap: 10px; margin-bottom: 16px; }
.sa-app[data-page="dashboard"] .dash-mini-card { min-height: 72px; padding: 14px 16px; border: 1px solid var(--hp-border-subtle); border-radius: var(--hp-radius-md); background: rgba(255,255,255,.9); box-shadow: var(--hp-shadow-xs); }
.sa-app[data-page="dashboard"] .dash-mini-value { color: var(--hp-text); font-size: var(--hp-font-lg); font-weight: var(--hp-weight-semibold); }
.sa-app[data-page="dashboard"] .dash-mini-label { margin-top: 2px; color: var(--hp-text-muted); font-size: var(--hp-font-2xs); font-weight: var(--hp-weight-medium); letter-spacing: .05em; }
.sa-app[data-page="dashboard"] .dash-section { border: 1px solid rgba(215,222,232,.92); border-radius: var(--hp-radius-lg); background: rgba(255,255,255,.96); box-shadow: var(--hp-shadow-xs); }
.sa-app[data-page="dashboard"] .dash-section-head { min-height: 58px; padding: 15px 18px; border-color: var(--hp-border-subtle); color: var(--hp-text); font-size: var(--hp-font-lg); font-weight: var(--hp-weight-strong); }
.sa-app[data-page="dashboard"] .dash-section-head :is(i,svg) { width: 14px !important; height: 14px !important; color: var(--hp-text-muted) !important; }
.sa-app[data-page="dashboard"] .dash-section-body { padding: 14px 18px; }
.sa-app[data-page="dashboard"] .dash-funnel-row { min-height: 38px; padding: 6px 0; }
.sa-app[data-page="dashboard"] .dash-funnel-bar { height: 5px; border-radius: var(--hp-radius-pill); }
.sa-app[data-page="dashboard"] .dash-activity-item { min-height: 36px; padding: 6px 0; border-color: var(--hp-border-subtle); }

.sa-app[data-page="product-health"] .sa-card:first-child { padding: 20px 22px !important; }
.sa-app[data-page="product-health"] .sa-card:first-child .form-label { color: var(--hp-text-secondary); font-size: var(--hp-font-sm); font-weight: var(--hp-weight-semibold); }
.sa-app[data-page="product-health"] .sa-card:first-child .form-input { min-height: var(--hp-control-md); border-color: var(--hp-border); background: var(--hp-surface); }
.sa-app[data-page="product-health"] .sa-content > div[style*="font-size:12px"] { color: var(--hp-text-muted) !important; }
.sa-app[data-page="product-health"] .sa-stat { padding: 18px 20px; }
.sa-app[data-page="product-health"] .sa-stat-value { font-size: var(--hp-font-2xl); }

.copilot-ops-shell { gap: 18px; }
.copilot-ops-toolbar { padding: 18px 20px; border-color: var(--hp-border); border-radius: var(--hp-radius-lg); background: rgba(255,255,255,.96); box-shadow: var(--hp-shadow-xs); }
.copilot-ops-toolbar-title { color: var(--hp-text); font-size: var(--hp-font-base); font-weight: var(--hp-weight-strong); }
.copilot-ops-toolbar-meta { color: var(--hp-text-muted); font-size: var(--hp-font-sm); }
.copilot-ops-period { min-height: var(--hp-control-md); padding: 0 11px; border-color: var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface); color: var(--hp-text-secondary); font-size: var(--hp-font-md); font-weight: var(--hp-weight-semibold); }
.copilot-ops-period.active { border-color: var(--hp-accent); background: var(--hp-accent-soft); color: var(--hp-accent-pressed); }
.copilot-ops-grid { gap: 14px; }
.copilot-ops-card { min-height: 154px; padding: 20px; border-color: var(--hp-border); border-radius: var(--hp-radius-lg); background: linear-gradient(145deg,#fff,#fafcff); box-shadow: var(--hp-shadow-xs); }
.copilot-ops-card:hover { border-color: var(--hp-accent-border); box-shadow: var(--hp-shadow-sm); transform: translateY(-2px); }
.copilot-ops-card-icon { width: 40px; height: 40px; border-radius: 14px; background: var(--hp-accent-soft); color: var(--hp-accent); }
.copilot-ops-card-value { margin-top: 18px; color: var(--hp-text); font-size: var(--hp-font-3xl); font-weight: var(--hp-weight-strong); letter-spacing: -.04em; }
.copilot-ops-card-label { margin-top: 4px; color: var(--hp-text-secondary); font-size: var(--hp-font-sm); font-weight: var(--hp-weight-medium); }
.copilot-ops-card-sub { margin-top: 6px; color: var(--hp-text-faint); font-size: var(--hp-font-xs); }
.copilot-ops-health { gap: 8px; }
.copilot-ops-health-section { padding: 14px 16px; }
.copilot-ops-health-title { color: var(--hp-text); font-size: var(--hp-font-md); font-weight: var(--hp-weight-semibold); }
.copilot-ops-metric { border-color: var(--hp-border-subtle); color: var(--hp-text-secondary); font-size: var(--hp-font-sm); }

/* Flat catalog/detail pages share one white data surface. */
.sa-app[data-page="organizations"] .sa-card,
.sa-app[data-page="users"] .sa-card,
.sa-app[data-page="billing"] .sa-card,
.sa-app[data-page="plans"] .sa-card,
.sa-app[data-page="modules"] .sa-card,
.sa-app[data-page="audit"] .sa-card,
.sa-app[data-page="client-setup"] .sa-card,
.sa-app[data-page="import-reviews"] .sa-card,
.sa-app[data-page="comms"] .sa-card,
.sa-app[data-page="team"] .sa-card { border-radius: var(--hp-radius-lg); box-shadow: var(--hp-shadow-xs); }
.sa-app[data-page="organizations"] .sa-table td:first-child,
.sa-app[data-page="users"] .sa-table td:first-child,
.sa-app[data-page="billing"] .sa-table td:first-child,
.sa-app[data-page="client-setup"] .sa-table td:first-child { color: var(--hp-text); }

.sa-app[data-page="org-detail"] .sa-tabs { margin-right: -24px; margin-left: -24px; padding-right: 24px; padding-left: 24px; }
.sa-app[data-page="org-detail"] .sa-card > h3,
.sa-app[data-page="client-request-detail"] .sa-card > h3,
.sa-app[data-page="import-review-detail"] .sa-card > h3 { color: var(--hp-text); font-size: var(--hp-font-base) !important; font-weight: var(--hp-weight-strong) !important; }
.sa-app[data-page="org-detail"] .sa-card[style*="padding"],
.sa-app[data-page="client-request-detail"] .sa-card[style*="padding"],
.sa-app[data-page="import-review-detail"] .sa-card[style*="padding"] { padding: 16px !important; }

/* Onboarding cards: calm progress, no floating dashboard tiles. */
.sa-app[data-page="onboarding"] .onb-section-title { margin: 24px 0 12px; color: var(--hp-text-muted); font-size: var(--hp-font-xs); font-weight: var(--hp-weight-semibold); letter-spacing: .075em; }
.sa-app[data-page="onboarding"] .onb-grid { gap: 14px; }
.sa-app[data-page="onboarding"] .onb-card { border: 1px solid var(--hp-border); border-radius: var(--hp-radius-lg); background: linear-gradient(145deg,#fff,#fbfcff); box-shadow: var(--hp-shadow-xs); transform: none; }
.sa-app[data-page="onboarding"] .onb-card:hover { border-color: var(--hp-accent-border); box-shadow: var(--hp-shadow-sm); transform: translateY(-2px); }
.sa-app[data-page="onboarding"] .onb-card-head { min-height: 82px; padding: 16px 18px; }
.sa-app[data-page="onboarding"] .onb-card-icon { width: 40px; height: 40px; border-radius: 14px; background: var(--hp-accent-soft) !important; }
.sa-app[data-page="onboarding"] .onb-card-icon :is(i,svg) { width: 18px !important; height: 18px !important; color: var(--hp-accent) !important; }
.sa-app[data-page="onboarding"] .onb-progress-bar { height: 5px; margin: 0 18px 17px; border-radius: var(--hp-radius-pill); background: var(--hp-surface-sunken); }
.sa-app[data-page="onboarding"] .onb-progress-fill { background: var(--hp-accent) !important; }
.sa-app[data-page="onboarding"] .onb-steps { border-color: var(--hp-border-subtle); }
.sa-app[data-page="onboarding"] .onb-step { min-height: 42px; padding: 8px 14px; border-color: var(--hp-border-subtle); }
.sa-app[data-page="onboarding"] .onb-check { width: 18px; height: 18px; border: 1px solid var(--hp-border-strong); border-radius: var(--hp-radius-xs); }
.sa-app[data-page="onboarding"] .onb-check.done { border-color: var(--hp-success); background: var(--hp-success); }

/* HPanel owns the internal client implementation workspace. */
.hpo-page { display: grid; gap: 18px; color: var(--hp-text); }
.hpo-loading { display: flex; min-height: 280px; align-items: center; justify-content: center; gap: 10px; color: var(--hp-text-muted); font-size: var(--hp-font-md); }
.hpo-kicker { color: var(--hp-text-muted); font-size: 10px; font-weight: var(--hp-weight-semibold); letter-spacing: .08em; text-transform: uppercase; }
.hpo-portfolio-hero,
.hpo-workspace-hero { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-lg); background: linear-gradient(145deg,var(--hp-surface),var(--hp-canvas-subtle)); box-shadow: var(--hp-shadow-xs); }
.hpo-portfolio-hero > div:first-child,
.hpo-workspace-identity { min-width: 0; flex: 1; }
.hpo-portfolio-hero h2,
.hpo-workspace-hero h2 { margin: 4px 0 5px; color: var(--hp-text); font-size: 24px; font-weight: var(--hp-weight-strong); letter-spacing: -.025em; }
.hpo-portfolio-hero p,
.hpo-workspace-hero p { margin: 0; color: var(--hp-text-muted); font-size: var(--hp-font-md); line-height: 1.45; }
.hpo-portfolio-stats { display: grid; grid-template-columns: repeat(3,minmax(86px,1fr)); gap: 8px; flex: 0 0 auto; }
.hpo-portfolio-stats span { display: grid; gap: 2px; min-width: 86px; padding: 10px 12px; border: 1px solid var(--hp-border-subtle); border-radius: var(--hp-radius-md); background: var(--hp-surface); color: var(--hp-text-muted); font-size: 11px; }
.hpo-portfolio-stats strong { color: var(--hp-text); font-size: 19px; font-weight: var(--hp-weight-strong); }
.hpo-portfolio-section { display: grid; gap: 10px; }
.hpo-section-heading { display: flex; align-items: center; gap: 8px; color: var(--hp-text-secondary); font-size: 12px; font-weight: var(--hp-weight-semibold); }
.hpo-section-heading :is(i,svg) { width: 15px; height: 15px; color: var(--hp-text-muted); }
.hpo-section-heading strong { min-width: 20px; padding: 2px 6px; border-radius: var(--hp-radius-pill); background: var(--hp-surface-sunken); color: var(--hp-text-muted); text-align: center; font-size: 10px; }
.hpo-portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(310px,1fr)); gap: 12px; }
.hpo-portfolio-card { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-lg); background: var(--hp-surface); box-shadow: var(--hp-shadow-xs); cursor: pointer; transition: border-color .16s,box-shadow .16s,transform .16s; }
.hpo-portfolio-card:hover { border-color: var(--hp-accent-border); box-shadow: var(--hp-shadow-sm); transform: translateY(-1px); }
.hpo-portfolio-card__head { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 11px; }
.hpo-org-mark { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: var(--hp-radius-md); background: var(--hp-accent-soft); color: var(--hp-accent); font-size: 14px; font-weight: var(--hp-weight-strong); }
.hpo-portfolio-card h3 { margin: 0 0 3px; overflow: hidden; color: var(--hp-text); font-size: 14px; font-weight: var(--hp-weight-semibold); text-overflow: ellipsis; white-space: nowrap; }
.hpo-portfolio-card p { margin: 0; color: var(--hp-text-muted); font-size: 11px; }
.hpo-percent { color: var(--hp-accent); font-size: 18px; font-weight: var(--hp-weight-strong); }
.hpo-progress { height: 6px; overflow: hidden; border-radius: var(--hp-radius-pill); background: var(--hp-surface-sunken); }
.hpo-progress span { display: block; height: 100%; border-radius: inherit; background: var(--hp-accent); transition: width .22s ease; }
.hpo-portfolio-card__foot { display: flex; justify-content: space-between; gap: 12px; min-width: 0; color: var(--hp-text-muted); font-size: 11px; }
.hpo-portfolio-card__foot span:last-child { overflow: hidden; color: var(--hp-text-secondary); text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.hpo-empty { padding: 32px; text-align: center; color: var(--hp-text-muted); }
.hpo-workspace-hero { padding: 16px 18px; }
.hpo-back { flex: 0 0 auto; }
.hpo-back :is(i,svg),
.hpo-workspace-actions :is(i,svg) { width: 15px; height: 15px; }
.hpo-workspace-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.hpo-start-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 17px; border: 1px solid var(--hp-warning-border); border-radius: var(--hp-radius-md); background: var(--hp-warning-soft); }
.hpo-start-banner > div { display: grid; gap: 3px; }
.hpo-start-banner strong { color: var(--hp-text); font-size: 13px; }
.hpo-start-banner span { color: var(--hp-text-secondary); font-size: 12px; }
.hpo-summary-band { display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,320px); align-items: center; gap: 18px; padding: 14px 16px; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface); }
.hpo-summary-band > div { display: grid; gap: 3px; }
.hpo-summary-band span,
.hpo-summary-band small { color: var(--hp-text-muted); font-size: 11px; }
.hpo-summary-band strong { color: var(--hp-text); font-size: 14px; font-weight: var(--hp-weight-semibold); }
.hpo-phases { display: grid; grid-template-columns: repeat(5,minmax(145px,1fr)); gap: 8px; overflow-x: auto; }
.hpo-phase { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 9px; min-height: 68px; padding: 10px; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface); color: var(--hp-text-secondary); text-align: left; cursor: pointer; }
.hpo-phase:hover,
.hpo-phase.is-active { border-color: var(--hp-accent-border); background: var(--hp-accent-soft); }
.hpo-phase > :is(i,svg) { width: 30px; height: 30px; padding: 7px; border-radius: var(--hp-radius-sm); background: var(--hp-surface-sunken); color: var(--hp-text-muted); }
.hpo-phase.is-active > :is(i,svg) { background: var(--hp-surface); color: var(--hp-accent); }
.hpo-phase span { display: grid; gap: 2px; min-width: 0; }
.hpo-phase strong { color: var(--hp-text); font-size: 12px; font-weight: var(--hp-weight-semibold); }
.hpo-phase small { overflow: hidden; color: var(--hp-text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.hpo-phase b { padding: 2px 6px; border: 1px solid var(--hp-border-subtle); border-radius: var(--hp-radius-pill); background: var(--hp-surface); color: var(--hp-text-muted); font-size: 10px; }
.hpo-workspace { display: grid; grid-template-columns: minmax(260px,300px) minmax(460px,1fr) minmax(270px,320px); gap: 12px; align-items: start; }
.hpo-step-rail,
.hpo-step-work,
.hpo-context > section { border: 1px solid var(--hp-border); border-radius: var(--hp-radius-lg); background: var(--hp-surface); box-shadow: var(--hp-shadow-xs); }
.hpo-step-rail { position: sticky; top: 82px; max-height: calc(100vh - 110px); overflow: auto; }
.hpo-panel-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding: 14px; border-bottom: 1px solid var(--hp-border-subtle); }
.hpo-panel-head span { color: var(--hp-text-muted); font-size: 10px; }
.hpo-panel-head h3 { margin: 2px 0 0; color: var(--hp-text); font-size: 15px; font-weight: var(--hp-weight-semibold); }
.hpo-panel-head b { padding: 3px 7px; border-radius: var(--hp-radius-pill); background: var(--hp-surface-sunken); color: var(--hp-text-muted); font-size: 10px; }
.hpo-step-list { display: grid; gap: 14px; padding: 11px; }
.hpo-step-list section { display: grid; gap: 7px; }
.hpo-step-list h4 { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--hp-text-muted); font-size: 10px; font-weight: var(--hp-weight-semibold); }
.hpo-step-list h4 :is(i,svg) { width: 13px; height: 13px; }
.hpo-step { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: start; gap: 8px; width: 100%; padding: 10px; border: 1px solid var(--hp-border-subtle); border-radius: var(--hp-radius-md); background: var(--hp-surface); color: var(--hp-text-secondary); text-align: left; cursor: pointer; }
.hpo-step:hover,
.hpo-step.is-active { border-color: var(--hp-accent-border); background: var(--hp-accent-soft); }
.hpo-step > :is(i,svg) { width: 28px; height: 28px; padding: 6px; border-radius: var(--hp-radius-pill); background: var(--hp-surface-sunken); color: var(--hp-text-muted); }
.hpo-step[data-tone="done"] > :is(i,svg) { background: var(--hp-success-soft); color: var(--hp-success); }
.hpo-step[data-tone="active"] > :is(i,svg) { background: var(--hp-accent-soft); color: var(--hp-accent); }
.hpo-step span { display: grid; gap: 3px; min-width: 0; }
.hpo-step strong { overflow: hidden; color: var(--hp-text); font-size: 12px; font-weight: var(--hp-weight-semibold); text-overflow: ellipsis; white-space: nowrap; }
.hpo-step small { display: -webkit-box; overflow: hidden; color: var(--hp-text-muted); font-size: 10px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.hpo-step em { color: var(--hp-text-muted); font-size: 9px; font-style: normal; font-weight: var(--hp-weight-semibold); }
.hpo-step > b { padding: 2px 5px; border: 1px solid var(--hp-warning-border); border-radius: var(--hp-radius-pill); background: var(--hp-warning-soft); color: var(--hp-warning); font-size: 8px; }
.hpo-step-work { min-width: 0; overflow: hidden; }
.hpo-step-work > header { display: flex; justify-content: space-between; gap: 14px; padding: 18px; border-bottom: 1px solid var(--hp-border-subtle); }
.hpo-step-work > header span { color: var(--hp-text-muted); font-size: 10px; }
.hpo-step-work > header h2 { margin: 4px 0; color: var(--hp-text); font-size: 20px; font-weight: var(--hp-weight-strong); }
.hpo-step-work > header p { margin: 0; color: var(--hp-text-muted); font-size: 12px; line-height: 1.45; }
.hpo-step-work > header > b { display: inline-flex; align-items: center; align-self: start; gap: 5px; padding: 6px 8px; border-radius: var(--hp-radius-pill); background: var(--hp-surface-sunken); color: var(--hp-text-secondary); font-size: 10px; white-space: nowrap; }
.hpo-step-work > header > b[data-tone="done"] { background: var(--hp-success-soft); color: var(--hp-success); }
.hpo-step-work > header > b[data-tone="active"] { background: var(--hp-accent-soft); color: var(--hp-accent); }
.hpo-step-work > header > b :is(i,svg) { width: 13px; height: 13px; }
.hpo-step-body { display: grid; grid-template-columns: minmax(0,1fr) minmax(210px,250px); }
.hpo-form-pane,
.hpo-evidence { display: grid; align-content: start; gap: 9px; padding: 18px; }
.hpo-form-pane > label,
.hpo-evidence > label { margin-top: 4px; color: var(--hp-text-secondary); font-size: 11px; font-weight: var(--hp-weight-semibold); }
.hpo-form-pane textarea { width: 100%; min-height: 138px; padding: 11px; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface); color: var(--hp-text); font: inherit; font-size: 12px; resize: vertical; }
.hpo-form-pane textarea:focus { border-color: var(--hp-accent); outline: 3px solid var(--hp-accent-soft); }
.hpo-form-pane textarea:disabled { background: var(--hp-surface-sunken); color: var(--hp-text-muted); }
.hpo-status-controls { display: grid; grid-template-columns: repeat(4,minmax(80px,1fr)); gap: 6px; }
.hpo-status-controls button { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 5px; padding: 7px; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-sm); background: var(--hp-surface); color: var(--hp-text-secondary); font: inherit; font-size: 11px; font-weight: var(--hp-weight-semibold); cursor: pointer; }
.hpo-status-controls button:hover,
.hpo-status-controls button.is-active { border-color: var(--hp-accent-border); background: var(--hp-accent-soft); color: var(--hp-accent); }
.hpo-status-controls button:disabled { opacity: .5; cursor: not-allowed; }
.hpo-status-controls :is(i,svg) { width: 13px; height: 13px; }
.hpo-step-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.hpo-evidence { border-left: 1px solid var(--hp-border-subtle); background: var(--hp-canvas-subtle); }
.hpo-evidence p { margin: 0; color: var(--hp-text-secondary); font-size: 12px; line-height: 1.5; }
.hpo-upload { display: grid; gap: 10px; padding: 12px; border: 1px dashed var(--hp-border-strong); border-radius: var(--hp-radius-md); background: var(--hp-surface); }
.hpo-upload > :is(span,a) { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; color: var(--hp-text-muted); font-size: 11px; }
.hpo-upload > a { color: var(--hp-accent); text-decoration: none; }
.hpo-upload > a :is(i,svg) { width: 13px; height: 13px; }
.hpo-upload label { width: max-content; cursor: pointer; }
.hpo-upload label.is-disabled { opacity: .5; cursor: not-allowed; }
.hpo-upload input { display: none; }
.hpo-guidance { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 0 18px 18px; }
.hpo-guidance section { padding: 12px; border: 1px solid var(--hp-border-subtle); border-radius: var(--hp-radius-md); }
.hpo-guidance h3,
.hpo-context h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 9px; color: var(--hp-text-secondary); font-size: 11px; font-weight: var(--hp-weight-semibold); }
.hpo-guidance h3 :is(i,svg),
.hpo-context h3 :is(i,svg) { width: 14px; height: 14px; color: var(--hp-text-muted); }
.hpo-guidance ul { display: grid; gap: 5px; margin: 0; padding-left: 17px; color: var(--hp-text-muted); font-size: 11px; line-height: 1.4; }
.hpo-context { display: grid; gap: 10px; }
.hpo-context > section { padding: 13px; }
.hpo-context dl { display: grid; gap: 7px; margin: 0; }
.hpo-context dl div { display: flex; justify-content: space-between; gap: 10px; }
.hpo-context dt { color: var(--hp-text-muted); font-size: 10px; }
.hpo-context dd { margin: 0; overflow-wrap: anywhere; color: var(--hp-text); font-size: 10px; font-weight: var(--hp-weight-semibold); text-align: right; }
.hpo-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.hpo-metrics > div { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 2px 7px; align-items: center; min-height: 49px; padding: 7px; border-radius: var(--hp-radius-sm); background: var(--hp-surface-sunken); }
.hpo-metrics :is(i,svg) { grid-row: span 2; width: 24px; height: 24px; padding: 5px; border-radius: var(--hp-radius-xs); background: var(--hp-surface); color: var(--hp-text-muted); }
.hpo-metrics strong { color: var(--hp-text); font-size: 15px; font-weight: var(--hp-weight-strong); line-height: 1; }
.hpo-metrics span { color: var(--hp-text-muted); font-size: 9px; }
.hpo-features { display: flex; flex-wrap: wrap; gap: 5px; }
.hpo-features span { padding: 4px 6px; border-radius: var(--hp-radius-pill); background: var(--hp-surface-sunken); color: var(--hp-text-secondary); font-size: 9px; font-weight: var(--hp-weight-semibold); }
.hpo-features small { color: var(--hp-text-muted); font-size: 10px; }
.hpo-context > section > strong { color: var(--hp-text); font-size: 11px; font-weight: var(--hp-weight-semibold); line-height: 1.4; }
.hpo-context > section > p { margin: 5px 0 0; color: var(--hp-text-muted); font-size: 10px; line-height: 1.45; }

@media (max-width: 1320px) {
  .hpo-workspace { grid-template-columns: minmax(245px,285px) minmax(420px,1fr); }
  .hpo-context { grid-column: 1 / -1; grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 1050px) {
  .hpo-phases { grid-template-columns: repeat(5,minmax(170px,1fr)); padding-bottom: 4px; }
  .hpo-workspace { grid-template-columns: 1fr; }
  .hpo-step-rail { position: static; max-height: none; }
  .hpo-context { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .hpo-portfolio-hero,
  .hpo-workspace-hero,
  .hpo-start-banner { align-items: stretch; flex-direction: column; }
  .hpo-portfolio-stats { width: 100%; }
  .hpo-workspace-actions { flex-wrap: wrap; }
  .hpo-summary-band,
  .hpo-step-body,
  .hpo-guidance,
  .hpo-context { grid-template-columns: 1fr; }
  .hpo-evidence { border-top: 1px solid var(--hp-border-subtle); border-left: 0; }
}
@media (max-width: 480px) {
  .hpo-portfolio-grid { grid-template-columns: 1fr; }
  .hpo-portfolio-stats,
  .hpo-status-controls,
  .hpo-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hpo-portfolio-stats span:last-child { grid-column: 1 / -1; }
}

/* Nested operational cards should read as rows inside a single surface. */
.sa-app[data-page="support"] .sa-card { border-color: var(--hp-border); border-radius: var(--hp-radius-lg); box-shadow: var(--hp-shadow-xs); }
.sa-app[data-page="support"] .sa-card .sa-card { border-color: var(--hp-border-subtle) !important; border-radius: var(--hp-radius-md); background: var(--hp-surface); box-shadow: var(--hp-shadow-xs) !important; }
.sa-app[data-page="support"] .sa-card .sa-card:hover { border-color: var(--hp-accent-border) !important; box-shadow: var(--hp-shadow-sm) !important; transform: translateY(-1px); }
.sa-app[data-page="ticket-detail"] .sa-card { box-shadow: var(--hp-shadow-xs); }
.sa-app[data-page="ticket-detail"] .sa-card:first-of-type { background: var(--hp-canvas-subtle); }

/* Documentation and module catalog surfaces. */
.sa-ui-map { gap: 12px; }
.sa-ui-map-hero { padding: 24px 26px; border-color: var(--hp-border); border-radius: var(--hp-radius-lg); background: linear-gradient(145deg,#fff,#f8faff); box-shadow: var(--hp-shadow-xs); }
.sa-ui-map-hero-icon, .sa-ui-map-card-icon, .sa-ui-map-summary-icon { border-radius: 50%; background: var(--hp-accent-soft); color: var(--hp-accent); }
.sa-ui-map-hero h2 { color: var(--hp-text); font-size: var(--hp-font-xl); font-weight: var(--hp-weight-strong); }
.sa-ui-map-hero p { color: var(--hp-text-muted); font-size: var(--hp-font-md); }
.sa-ui-map-tab { min-height: var(--hp-control-md); padding: 0 11px; border-color: var(--hp-border); border-radius: var(--hp-radius-md); color: var(--hp-text-secondary); font-size: var(--hp-font-md); font-weight: var(--hp-weight-semibold); }
.sa-ui-map-tab.active { border-color: var(--hp-accent); background: var(--hp-accent-soft); color: var(--hp-accent-pressed); }
.sa-ui-map-summary-card, .sa-ui-map-card, .sa-erp-visual-list, .sa-erp-visual-preview { border-color: var(--hp-border); border-radius: var(--hp-radius-lg); box-shadow: var(--hp-shadow-xs); }
.sa-ui-map-card-title, .sa-erp-visual-list-title, .sa-erp-visual-item-title { color: var(--hp-text); font-weight: var(--hp-weight-semibold); }
.sa-erp-visual-item.active { border-color: var(--hp-accent-border); background: var(--hp-accent-soft); box-shadow: inset 2px 0 0 var(--hp-accent); }

/* Sales workspace */
.sales-workspace { color: var(--hp-text); }
.sales-toolbar { margin: -28px -32px 0; padding: 24px 32px 0; border-color: var(--hp-border-subtle); background: rgba(255,255,255,.86); backdrop-filter: blur(16px) saturate(140%); }
.sales-toolbar-top { align-items: center; gap: var(--hp-space-4); }
.sales-eyebrow { color: var(--hp-text-muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.sales-heading { margin-top: 3px; color: var(--hp-text); font-size: 26px; font-weight: var(--hp-weight-strong); letter-spacing: -.045em; }
.sales-heading-meta { margin-top: 5px; color: var(--hp-text-muted); font-size: 12px; }
.sales-actions { gap: 8px; }
.sales-workspace-tabs { margin-top: 18px; gap: 24px; }
.sales-workspace-tab { min-height: 44px; padding: 0 1px; color: var(--hp-text-muted); font-size: 12px; font-weight: 600; }
.sales-workspace-tab.active { color: var(--hp-text); }
.sales-workspace-tab.active::after { right: 0; left: 0; height: 2px; background: var(--hp-accent); }
.sales-workspace-tab :is(i,svg) { width: 13px; height: 13px; flex: 0 0 auto; }
.sales-tab-count { height: 17px; min-width: 17px; border-radius: var(--hp-radius-pill); background: var(--hp-border-subtle); color: var(--hp-text-muted); font-size: 9px; }
.sales-workspace-tab.active .sales-tab-count { background: var(--hp-accent-soft); color: var(--hp-accent); }
.sales-workspace-body { padding-top: 18px; }

.sales-collection-bar { display: flex; align-items: center; gap: 24px; min-height: 46px; margin: 0 -32px; padding: 0 32px; overflow-x: auto; border-bottom: 1px solid var(--hp-border-subtle); background: rgba(255,255,255,.86); scrollbar-width: none; }
.sales-collection-bar::-webkit-scrollbar { display: none; }
.sales-collection-tab { position: relative; min-height: 46px; padding: 0; border: 0; background: transparent; color: var(--hp-text-muted); white-space: nowrap; font-size: 12px; font-weight: 600; cursor: pointer; }
.sales-collection-tab:hover { color: var(--hp-text-secondary); }
.sales-collection-tab.active { color: var(--hp-text); }
.sales-collection-tab.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--hp-accent); }
.sales-collection-count { margin-left: 5px; color: var(--hp-text-faint); font-size: 9px; font-weight: 650; }
.sales-collection-tab.active .sales-collection-count { color: var(--hp-accent); }

.sales-command-bar { display: flex; align-items: center; gap: 9px; margin: 18px 0 14px; }
.sales-command-spacer { flex: 1; }
.sales-view-switch { flex: 0 0 auto; padding: 3px; border: 1px solid var(--hp-border-subtle); border-radius: var(--hp-radius-md); background: var(--hp-surface-sunken); }
.sales-view-button { height: 30px; padding: 0 10px; border-radius: var(--hp-radius-sm); color: var(--hp-text-muted); font-size: 11px; font-weight: 600; }
.sales-view-button.active { background: var(--hp-surface); color: var(--hp-text); box-shadow: var(--hp-shadow-xs); }
.sales-view-button :is(i,svg) { width: 13px; height: 13px; flex: 0 0 auto; }
.sales-search { position: relative; display: block; height: var(--hp-control-sm); min-width: 260px; flex: 0 1 360px; }
.sales-search > :is(i,svg) { position: absolute; z-index: 1; top: 9px; left: 10px; width: 14px; height: 14px; color: var(--hp-text-faint); pointer-events: none; }
.sales-search input { display: block; height: var(--hp-control-sm); padding-left: 31px; border-color: var(--hp-border); border-radius: var(--hp-radius-md); color: var(--hp-text); font-size: 11px; }
.sales-search input:focus { border-color: #9aa8e8; box-shadow: 0 0 0 3px rgba(77,99,217,.08); }
.sales-icon-button { min-width: var(--hp-control-sm); height: var(--hp-control-sm); padding: 0 10px; border-color: var(--hp-border); border-radius: var(--hp-radius-md); color: var(--hp-text-secondary); font-size: 10px; font-weight: 600; }
.sales-icon-button:hover { border-color: var(--hp-border-strong); background: var(--hp-surface-hover); color: var(--hp-text); }
.sales-icon-button :is(i,svg) { width: 13px; height: 13px; flex: 0 0 auto; }
.sales-stage-select { height: var(--hp-control-sm); min-width: 126px; padding: 0 28px 0 10px; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface); color: var(--hp-text-secondary); font-size: 10px; font-weight: 600; outline: none; }
.sales-filter-menu { position: relative; flex: 0 0 auto; }
.sales-filter-menu > summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; user-select: none; }
.sales-filter-menu > summary::-webkit-details-marker { display: none; }
.sales-filter-menu > summary.active,
.sales-filter-menu[open] > summary { border-color: #b7c2ef; background: #f4f6ff; color: var(--hp-accent); }
.sales-filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--hp-accent); color: #fff; font-size: 9px; font-weight: 700; }
.sales-filter-count[hidden] { display: none; }
.sales-filter-panel { position: absolute; z-index: 50; top: calc(100% + 10px); right: 0; width: 344px; padding: 16px; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-lg); background: rgba(255,255,255,.98); box-shadow: var(--hp-shadow-popover); }
.sales-filter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.sales-filter-head strong { display: block; color: var(--hp-text); font-size: 13px; font-weight: 650; }
.sales-filter-head span { display: block; margin-top: 2px; color: var(--hp-text-muted); font-size: 10px; }
.sales-filter-clear { padding: 2px 0; border: 0; background: transparent; color: var(--hp-accent); font-size: 10px; font-weight: 600; cursor: pointer; }
.sales-filter-clear:disabled { color: var(--hp-text-faint); cursor: default; }
.sales-filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sales-filter-field { display: grid; gap: 5px; min-width: 0; }
.sales-filter-field > span { color: var(--hp-text-secondary); font-size: 9px; font-weight: 600; }
.sales-filter-field select { width: 100%; height: 32px; padding: 0 25px 0 9px; border: 1px solid var(--hp-border); border-radius: 7px; background: #fff; color: var(--hp-text); font-size: 10px; font-weight: 500; outline: none; }
.sales-filter-field select:focus { border-color: #9aa8e8; box-shadow: 0 0 0 3px rgba(77,99,217,.08); }
.sales-filter-field .hx-select-btn { min-height: 32px; height: 32px; padding: 0 9px; border-color: var(--hp-border); border-radius: 7px; color: var(--hp-text); font-size: 10px; font-weight: 500; }
.sales-filter-field .hx-select-menu { z-index: 80; top: calc(100% + 3px); max-height: 190px; border-color: var(--hp-border); border-radius: 8px; box-shadow: 0 10px 24px rgba(21,30,52,.14); }
.sales-filter-field .hx-select-opt { padding: 7px 9px; color: var(--hp-text); font-size: 10px; line-height: 1.3; }
.sales-filter-field .hx-select-opt:hover { background: #f4f6fb; }
.sales-filter-field .hx-select-opt.sel { background: #eef2ff; color: var(--hp-accent); }
.sales-multi-filter { position: relative; min-width: 0; }
.sales-multi-filter > summary { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-md); background: #fff; color: var(--hp-text); display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; font-size: 10px; font-weight: 520; cursor: pointer; box-shadow: var(--hp-shadow-xs); }
.sales-multi-filter > summary::-webkit-details-marker { display: none; }
.sales-multi-filter > summary > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sales-multi-filter > summary :is(i,svg) { width: 13px; height: 13px; flex: 0 0 auto; color: var(--hp-text-muted); transition: transform var(--hp-transition); }
.sales-multi-filter[open] > summary { border-color: var(--hp-blue-300); box-shadow: 0 0 0 3px rgba(53,109,243,.09); }
.sales-multi-filter[open] > summary :is(i,svg) { transform: rotate(180deg); }
.sales-multi-filter.active > summary { border-color: var(--hp-accent-border); background: var(--hp-accent-soft); color: var(--hp-accent-pressed); }
.sales-multi-filter-menu { position: absolute; z-index: 90; top: calc(100% + 7px); right: 0; left: 0; min-width: 210px; overflow: hidden; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-md); background: rgba(255,255,255,.99); box-shadow: var(--hp-shadow-popover); }
.sales-multi-filter-head { min-height: 38px; padding: 8px 10px; border-bottom: 1px solid var(--hp-border-subtle); background: var(--hp-canvas-subtle); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sales-multi-filter-head > span { color: var(--hp-text-secondary); font-size: 9px; font-weight: 650; }
.sales-multi-filter-head button { padding: 3px 0; border: 0; background: transparent; color: var(--hp-accent); font-size: 9px; font-weight: 650; cursor: pointer; }
.sales-multi-filter-head button:disabled { color: var(--hp-text-faint); cursor: default; }
.sales-multi-filter-options { max-height: 210px; overflow-y: auto; padding: 5px; }
.sales-multi-filter-options label { min-height: 34px; margin: 0; padding: 6px 7px; border-radius: var(--hp-radius-sm); color: var(--hp-text-secondary); display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 520; cursor: pointer; }
.sales-multi-filter-options label:hover { background: var(--hp-surface-hover); color: var(--hp-text); }
.sales-multi-filter-options input.sa-check-input { flex: 0 0 auto; margin: 0; }
.sales-filter-result { margin: 15px -16px -16px; padding: 12px 16px; border-top: 1px solid var(--hp-border-subtle); border-radius: 0 0 var(--hp-radius-lg) var(--hp-radius-lg); background: #f8f9fb; color: var(--hp-text-muted); font-size: 10px; }

.sales-summary-grid { gap: 12px; margin-bottom: 16px; }
.sales-summary-card { padding: 16px 18px; border-color: var(--hp-border-subtle); border-radius: var(--hp-radius-lg); background: linear-gradient(145deg,#fff,#fbfcff); box-shadow: var(--hp-shadow-xs); }
.sales-summary-label { color: var(--hp-text-muted); font-size: 9px; font-weight: 600; }
.sales-summary-value { margin-top: 4px; color: var(--hp-text); font-size: 20px; font-weight: 650; }
.sales-summary-sub { color: var(--hp-text-faint); font-size: 9px; }
.sales-panel { border-color: var(--hp-border-subtle); border-radius: var(--hp-radius-lg); box-shadow: var(--hp-shadow-xs); }
.sales-panel-head { min-height: 48px; padding: 11px 14px; border-color: var(--hp-border-subtle); }
.sales-panel-title { color: var(--hp-text); font-size: 12px; font-weight: 650; }
.sales-panel-meta { color: var(--hp-text-muted); font-size: 9px; }
.sales-task-row { min-height: 56px; border-color: var(--hp-border-subtle); }
.sales-task-row:hover { background: var(--hp-surface-hover); }
.sales-task-icon :is(i,svg), .sales-done-button :is(i,svg) { width: 13px; height: 13px; }
.sales-type-icon :is(i,svg) { width: 13px; height: 13px; }
.sales-empty :is(i,svg) { width: 24px; height: 24px; }

.sales-board { gap: 12px; min-height: 0; padding: 0 0 14px; align-items: flex-start; }
.sales-board-column { min-width: 232px; width: 232px; max-height: calc(100vh - 264px); border-color: rgba(var(--column-rgb),.12); border-radius: var(--hp-radius-lg); background: linear-gradient(180deg,rgba(var(--column-rgb),.05),rgba(255,255,255,.54)); box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.sales-board-column.drag-over { border-color: rgba(var(--column-rgb),.4); background: rgba(var(--column-rgb),.075); }
.sales-column-head { min-height: 46px; padding: 10px 12px; border-bottom: 1px solid rgba(var(--column-rgb),.09); }
.sales-column-dot { width: 6px; height: 6px; }
.sales-column-name { color: var(--hp-text-secondary); font-size: 10px; font-weight: 650; }
.sales-column-count { height: 18px; min-width: 18px; padding: 0 5px; border-radius: var(--hp-radius-xs); font-size: 9px; }
.sales-column-body { gap: 8px; padding: 8px; }
.sales-lead-card { padding: 12px; border-color: var(--hp-border-subtle); border-radius: var(--hp-radius-md); background: rgba(255,255,255,.98); box-shadow: var(--hp-shadow-xs); cursor: pointer; transform: none; }
.sales-lead-card:hover { border-color: var(--hp-accent-border); box-shadow: var(--hp-shadow-sm); transform: translateY(-1px); }
.sales-card-head { gap: 7px; }
.sales-card-identity { min-width: 0; }
.sales-card-company { color: var(--hp-text); font-size: 12px; font-weight: 650; line-height: 1.35; }
.sales-card-contact { color: var(--hp-text-muted); font-size: 10px; }
.sales-age { padding: 1px 4px; border-radius: var(--hp-radius-xs); background: var(--hp-canvas); color: var(--hp-text-muted); font-size: 8px; }
.sales-card-fields { gap: 5px; margin-top: 8px; padding-top: 8px; border-color: var(--hp-border-subtle); }
.sales-card-field { color: var(--hp-text-secondary); font-size: 9px; line-height: 1.3; }
.sales-card-field :is(i,svg) { width: 11px; height: 11px; flex: 0 0 auto; color: var(--hp-text-faint); }
.sales-card-field.attention { color: var(--hp-accent); }
.sales-card-footer:empty { display: none; }
.sales-card-footer { min-height: 0; margin-top: 8px; }
.sales-card-tag { max-width: 112px; padding: 2px 5px; border-radius: var(--hp-radius-xs); background: var(--hp-accent-soft); color: var(--hp-accent); font-size: 8px; }
.sales-card-assignee { color: var(--hp-text-muted); font-size: 8px; }
.sales-column-empty { padding: 22px 6px; color: rgba(var(--column-rgb),.45); font-size: 9px; }

.sales-list-wrap { border-color: var(--hp-border-subtle); border-radius: var(--hp-radius-md); box-shadow: var(--hp-shadow-xs); }
.sales-list th { padding: 9px 11px; border-color: var(--hp-border-subtle); background: var(--hp-canvas-subtle); color: var(--hp-text-muted); font-size: 8px; }
.sales-list td { padding: 10px 11px; border-color: var(--hp-border-subtle); color: var(--hp-text-secondary); font-size: 10px; }
.sales-list tbody tr { cursor: pointer; }
.sales-list tbody tr:hover { background: var(--hp-surface-hover); }
.sales-list-company { color: var(--hp-text); font-size: 10px; font-weight: 650; }
.sales-list-contact { color: var(--hp-text-muted); font-size: 9px; }
.sales-stage-pill { border-radius: var(--hp-radius-xs); font-size: 8px; }
.crm-card-settings-dialog { width: 680px; max-width: calc(100vw - 28px); max-height: min(720px,calc(100vh - 28px)); padding: 26px; }
.crm-card-settings-dialog h2 { margin: 0; color: #0b0c0f; font-size: 18px; font-weight: 650; letter-spacing: -.015em; }
.crm-card-settings-dialog .sales-card-settings-note { max-width: 560px; margin: 7px 0 18px; color: #45474e; font-size: 10.5px; line-height: 1.5; }
.crm-card-settings-dialog .sa-modal-actions { margin-top: 18px; }
.sales-card-settings-list { display: block; }
.sales-card-config { display: grid; grid-template-columns: minmax(280px,1fr) 230px; align-items: start; gap: 18px; }
.sales-field-picker, .sales-card-preview { min-width: 0; }
.sales-field-picker { overflow: hidden; border: 1px solid #e1e2e5; border-radius: 10px; background: #fff; }
.sales-field-picker-head { min-height: 36px; padding: 0 11px; border-bottom: 1px solid #e7e7e9; display: flex; align-items: center; justify-content: space-between; color: #3c3e44; font-size: 9px; font-weight: 600; }
.sales-field-option { min-height: 42px; padding: 7px 9px 7px 10px; border-bottom: 1px solid #ededee; background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sales-field-option:last-child { border-bottom: 0; }
.sales-field-option.selected { background: #f8f9fc; box-shadow: inset 2px 0 0 #6074df; }
.crm-card-settings-dialog .sales-field-option label { flex: 1; min-width: 0; margin: 0; display: flex; align-items: center; gap: 9px; color: #17181c; font-size: 10.5px; font-weight: 520; cursor: pointer; }
.crm-card-settings-dialog .sales-field-option label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-card-settings-dialog .sales-field-option input[type="checkbox"] { appearance: auto; -webkit-appearance: checkbox; flex: 0 0 16px; width: 16px; min-width: 16px; height: 16px; margin: 0; padding: 0; border: 0; border-radius: 3px; box-shadow: none; accent-color: var(--hp-accent); }
.sales-field-order { flex: 0 0 auto; min-width: 77px; display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.sales-field-order:empty { visibility: hidden; }
.sales-field-order > span { width: 19px; height: 19px; border-radius: 5px; background: #eef0f6; color: #34363c; display: inline-flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 600; }
.sales-field-order button { width: 24px; height: 24px; padding: 0; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-xs); background: var(--hp-surface); color: var(--hp-text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.sales-field-order button:hover:not(:disabled) { border-color: var(--hp-border-strong); color: var(--hp-text); }
.sales-field-order button:disabled { opacity: .35; cursor: default; }
.sales-field-order :is(i,svg) { width: 11px; height: 11px; }
.sales-card-preview { align-self: start; padding: 10px; border: 1px solid #e1e2e5; border-radius: 10px; background: #f6f6f7; }
.sales-card-preview .sales-field-picker-head { min-height: 24px; padding: 0 2px 8px; border-bottom: 0; }
.sales-card-preview .sales-lead-card { margin-top: 2px; }

/* Pipeline editor — compact, reference-led stage rows with an anchored palette. */
.crm-pipeline-settings-dialog { width: 780px; max-width: calc(100vw - 28px); max-height: min(760px,calc(100vh - 28px)); overflow: visible; padding: 0; border-radius: 16px; }
.crm-pipeline-settings-head { min-height: 82px; padding: 22px 24px 18px; border-bottom: 1px solid var(--hp-border-subtle); display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.crm-pipeline-settings-head h2 { margin: 0; color: var(--hp-text); font-size: 18px; font-weight: 640; letter-spacing: -.02em; }
.crm-pipeline-settings-head p { max-width: 610px; margin: 6px 0 0; color: var(--hp-text-muted); font-size: 10.5px; line-height: 1.5; }
.crm-pipeline-close { flex: 0 0 auto; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--hp-text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.crm-pipeline-close:hover { background: var(--hp-surface-hover); color: var(--hp-text); }
.crm-pipeline-close :is(i,svg) { width: 15px; height: 15px; }
.crm-pipeline-editor { min-height: 400px; max-height: min(550px,calc(100vh - 190px)); overflow-y: auto; padding: 20px 24px; display: grid; grid-template-columns: minmax(430px,1fr) 210px; align-items: start; gap: 22px; }
.crm-pipeline-stage-list { min-width: 0; border: 1px solid var(--hp-border); border-radius: 11px; background: var(--hp-surface); }
.crm-pipeline-list-head { min-height: 34px; padding: 0 12px; border-bottom: 1px solid var(--hp-border-subtle); display: flex; align-items: center; justify-content: space-between; color: var(--hp-text-muted); font-size: 8.5px; font-weight: 560; }
.crm-pipeline-stage-row { position: relative; min-height: 48px; padding: 6px 8px; border-bottom: 1px solid var(--hp-border-subtle); display: grid; grid-template-columns: 22px 28px minmax(130px,1fr) 72px 92px; align-items: center; gap: 6px; background: var(--hp-surface); }
.crm-pipeline-stage-row[draggable="true"] { cursor: grab; }
.crm-pipeline-stage-row[draggable="true"]:active { cursor: grabbing; }
.crm-pipeline-stage-row:hover { background: #fbfbfc; }
.crm-pipeline-drag { color: #989aa1; display: inline-flex; align-items: center; justify-content: center; }
.crm-pipeline-drag :is(i,svg) { width: 14px; height: 14px; }
.crm-pipeline-color-wrap { position: relative; }
.crm-pipeline-color { width: 22px; height: 22px; padding: 0; border: 4px solid #fff; border-radius: 50%; background: var(--stage-color); box-shadow: 0 0 0 1px #d5d7dc; cursor: pointer; }
.crm-pipeline-color:hover { box-shadow: 0 0 0 2px rgba(47,107,232,.22); }
.crm-pipeline-palette { position: absolute; z-index: 4; top: 30px; left: -8px; width: 148px; padding: 9px; border: 1px solid #dfe1e6; border-radius: 10px; background: #fff; box-shadow: 0 14px 34px rgba(15,23,42,.16); display: grid; grid-template-columns: repeat(5,20px); gap: 7px; }
.crm-pipeline-palette.open-up { top: auto; bottom: 30px; }
.crm-pipeline-palette button { width: 20px; height: 20px; padding: 0; border: 3px solid #fff; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px #d5d7dc; cursor: pointer; }
.crm-pipeline-palette button.active { box-shadow: 0 0 0 2px #111318; }
.crm-pipeline-name-input { width: 100%; min-width: 0; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--hp-text); font: inherit; font-size: 10.5px; font-weight: 560; outline: none; }
.crm-pipeline-name-input:hover { border-color: var(--hp-border); background: #fff; }
.crm-pipeline-name-input:focus { border-color: #9cb8f5; background: #fff; box-shadow: 0 0 0 2px rgba(47,107,232,.1); }
.crm-pipeline-type, .crm-pipeline-leads { overflow: hidden; color: var(--hp-text-muted); font-size: 8px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.crm-pipeline-type { color: var(--hp-accent); font-weight: 600; }
.crm-pipeline-row-actions { display: flex; justify-content: flex-end; gap: 3px; }
.crm-pipeline-row-actions button { width: 26px; height: 26px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #6d7078; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.crm-pipeline-row-actions button:hover:not(:disabled) { border-color: var(--hp-border); background: #fff; color: var(--hp-text); }
.crm-pipeline-row-actions button.danger:hover:not(:disabled) { border-color: #f0caca; background: #fff5f5; color: #b43f3f; }
.crm-pipeline-row-actions button:disabled { opacity: .22; cursor: default; }
.crm-pipeline-row-actions :is(i,svg) { width: 12px; height: 12px; }
.crm-pipeline-add { width: 100%; min-height: 42px; padding: 0 14px; border: 0; border-radius: 0 0 var(--hp-radius-lg) var(--hp-radius-lg); background: #fff; color: var(--hp-accent); display: flex; align-items: center; justify-content: flex-start; gap: 7px; font-size: 10px; font-weight: 600; cursor: pointer; }
.crm-pipeline-add:hover:not(:disabled) { background: var(--hp-accent-soft); }
.crm-pipeline-add:disabled { color: var(--hp-text-faint); cursor: default; }
.crm-pipeline-add :is(i,svg) { width: 13px; height: 13px; }
.crm-pipeline-retired-row { min-height: 58px; padding: 8px 10px 8px 38px; border-bottom: 1px solid #f0dede; background: #fffafa; display: grid; grid-template-columns: minmax(120px,1fr) 150px 42px; align-items: center; gap: 8px; }
.crm-pipeline-retired-row > div { min-width: 0; }
.crm-pipeline-retired-row strong { display: block; overflow: hidden; color: #2b2c31; font-size: 10px; font-weight: 600; text-decoration: line-through; text-overflow: ellipsis; white-space: nowrap; }
.crm-pipeline-retired-row span { display: block; margin-top: 2px; color: #805c5c; font-size: 8px; }
.crm-pipeline-retired-row select { width: 100%; height: 30px; padding: 0 24px 0 8px; border: 1px solid #dfcaca; border-radius: 6px; background: #fff; color: #28292e; font-size: 9px; }
.crm-pipeline-retired-row > button { height: 28px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; color: var(--hp-accent); font-size: 8.5px; font-weight: 600; cursor: pointer; }
.crm-pipeline-preview { min-width: 0; padding: 13px; border-radius: 11px; background: #f5f6f8; }
.crm-pipeline-preview-label { margin-bottom: 10px; color: #3a3c43; font-size: 9px; font-weight: 620; }
.crm-pipeline-preview-flow { display: flex; flex-direction: column; gap: 5px; }
.crm-pipeline-preview-flow > div { min-height: 29px; padding: 0 7px; border: 1px solid rgba(20,24,33,.06); border-left: 2px solid var(--stage-color); border-radius: 6px; background: #fff; display: grid; grid-template-columns: 7px minmax(0,1fr) auto; align-items: center; gap: 6px; }
.crm-pipeline-preview-flow span { width: 6px; height: 6px; border-radius: 50%; background: var(--stage-color); }
.crm-pipeline-preview-flow strong { overflow: hidden; color: #24262b; font-size: 8.5px; font-weight: 580; text-overflow: ellipsis; white-space: nowrap; }
.crm-pipeline-preview-flow small { color: #7b7e86; font-size: 7.5px; }
.crm-pipeline-preview p { margin: 12px 1px 0; color: #6d7078; font-size: 8px; line-height: 1.5; }
.crm-pipeline-settings-actions { min-height: 68px; margin: 0; padding: 14px 24px; border-top: 1px solid var(--hp-border-subtle); }
.crm-pipeline-settings-status { flex: 1; color: var(--hp-text-muted); font-size: 9px; }

@media (max-width: 760px) {
  .crm-pipeline-settings-dialog { overflow: hidden; }
  .crm-pipeline-editor { grid-template-columns: 1fr; padding: 14px; }
  .crm-pipeline-preview { display: none; }
  .crm-pipeline-stage-row { grid-template-columns: 18px 26px minmax(100px,1fr) 64px 84px; }
}

/* Deep prospect sidecar — profile rail + working timeline. */
.crm-sidecar-shell { position: fixed; inset: 0; z-index: 10040; pointer-events: none; }
.crm-sidecar-shell.open { pointer-events: auto; }
.crm-sidecar-backdrop { position: absolute; inset: 0; background: rgba(14,22,36,.46); opacity: 0; backdrop-filter: blur(8px) saturate(90%); transition: opacity 220ms ease; }
.crm-sidecar-shell.open .crm-sidecar-backdrop { opacity: 1; }
.crm-sidecar { --hp-text: #0c1017; --hp-text-secondary: #252c36; --hp-text-muted: #596270; --hp-text-faint: #87909d; --hp-border-subtle: #e8ecf2; position: absolute; top: 0; right: 0; bottom: 0; width: min(1160px, calc(100vw - 64px)); overflow: visible; border: 1px solid rgba(220,226,235,.95); border-right: 0; border-radius: var(--hp-radius-2xl) 0 0 var(--hp-radius-2xl); background: var(--hp-surface); box-shadow: var(--hp-shadow-drawer); transform: translateX(calc(101% + 54px)); transition: transform 260ms cubic-bezier(.2,.8,.2,1); }
.crm-sidecar-shell.open .crm-sidecar { transform: translateX(0); }
.crm-sidecar-close { position: absolute; z-index: 3; top: 24px; left: -48px; width: 48px; height: 52px; padding: 0; border: 1px solid rgba(255,255,255,.1); border-right: 0; border-radius: var(--hp-radius-lg) 0 0 var(--hp-radius-lg); background: linear-gradient(180deg,#202b40 0%,#151d2e 100%); color: #fff; box-shadow: -12px 14px 32px rgba(14,22,36,.24),inset 0 1px 0 rgba(255,255,255,.07); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background var(--hp-transition),box-shadow var(--hp-transition); }
.crm-sidecar-close:hover { background: linear-gradient(180deg,#2c3951 0%,#202b40 100%); box-shadow: -14px 16px 36px rgba(14,22,36,.28),inset 0 1px 0 rgba(255,255,255,.09); }
.crm-sidecar-close :is(i,svg) { width: 15px; height: 15px; }
.crm-sidecar-loading { padding: 64px 24px; color: var(--hp-text-muted); text-align: center; font-size: 11px; }
.crm-prospect-layout { height: 100%; min-height: 0; overflow: hidden; border-radius: inherit; display: grid; grid-template-columns: 340px minmax(0,1fr); }
.crm-prospect-profile { min-width: 0; overflow-y: auto; border-right: 1px solid #e1e6ee; background: linear-gradient(180deg,#f8f9fb,#f3f5f8); scrollbar-width: thin; }
.crm-profile-identity { min-height: 92px; padding: 22px 22px 14px; background: transparent; display: grid; grid-template-columns: minmax(0,1fr) 30px; align-items: center; gap: 10px; }
.crm-profile-heading { min-width: 0; }
.crm-profile-name { overflow: hidden; color: var(--hp-text); font-size: 20px; font-weight: var(--hp-weight-strong); letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.crm-profile-role { margin-top: 4px; overflow: hidden; color: var(--hp-text-muted); font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.crm-profile-more { width: 24px; height: 28px; padding: 0; border: 0; border-radius: var(--hp-radius-sm); background: transparent; color: var(--hp-text-muted); cursor: pointer; }
.crm-profile-more:hover { background: var(--hp-surface-hover); color: var(--hp-text); }
.crm-profile-more :is(i,svg) { width: 14px; height: 14px; }
.crm-profile-actions { padding: 0 22px 18px; background: transparent; display: flex; gap: 8px; }
.crm-profile-actions :is(button,a) { width: 38px; height: 38px; padding: 0; border: 1px solid var(--hp-border); border-radius: 13px; background: rgba(255,255,255,.94); color: var(--hp-text-secondary); box-shadow: var(--hp-shadow-xs); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; transition: border-color var(--hp-transition), color var(--hp-transition), background var(--hp-transition), transform var(--hp-transition), box-shadow var(--hp-transition); }
.crm-profile-actions :is(button,a):hover { border-color: #b6caf8; background: var(--hp-accent-soft); color: var(--hp-accent); }
.crm-profile-actions :is(button,a):hover { transform: translateY(-1px); box-shadow: var(--hp-shadow-sm); }
.crm-profile-actions :is(i,svg) { width: 15px; height: 15px; }
.crm-profile-stats { min-height: 72px; border-top: 1px solid #e1e6ee; border-bottom: 1px solid #e1e6ee; background: rgba(237,240,245,.78); display: grid; grid-template-columns: repeat(3,1fr); }
.crm-profile-stats > div { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.crm-profile-stats > div + div::before { content: ""; position: absolute; top: 14px; bottom: 14px; left: 0; width: 1px; background: var(--hp-border-subtle); }
.crm-profile-stats strong { color: var(--hp-text); font-size: 15px; font-weight: var(--hp-weight-strong); }
.crm-profile-stats span { margin-top: 3px; color: var(--hp-text-muted); font-size: 9px; font-weight: 500; letter-spacing: .01em; }
.crm-profile-section { margin: 0; padding: 22px 22px 18px; border: 0; border-bottom: 1px solid var(--hp-border-subtle); border-radius: 0; background: transparent; }
.crm-profile-section-title { margin-bottom: 12px; color: var(--hp-text); font-size: 14px; font-weight: var(--hp-weight-strong); letter-spacing: -.02em; }
.crm-profile-contact { min-height: 52px; display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: center; gap: 10px; }
.crm-profile-contact > :is(i,svg) { width: 13px; height: 13px; color: #28292d; }
.crm-profile-contact span, .crm-profile-control > span, .crm-profile-fact > span { display: block; color: var(--hp-text-muted); font-size: 10px; font-weight: 500; letter-spacing: 0; }
.crm-profile-contact strong { display: block; margin-top: 3px; overflow-wrap: anywhere; color: var(--hp-text); font-size: 12px; font-weight: 600; line-height: 1.4; }
.crm-profile-control, .crm-profile-fact { min-height: 42px; border-top: 1px solid var(--hp-border-subtle); display: grid; grid-template-columns: 92px minmax(0,1fr); align-items: center; gap: 10px; }
.crm-profile-section-title + .crm-profile-control, .crm-profile-section-title + .crm-profile-fact { border-top: 0; }
.crm-profile-select { appearance: none; -webkit-appearance: none; justify-self: end; width: auto; max-width: 142px; height: 26px; min-height: 26px; padding: 0 19px 0 7px; border: 0; border-radius: 6px; background-color: transparent; background-image: linear-gradient(45deg,transparent 50%,#686a70 50%),linear-gradient(135deg,#686a70 50%,transparent 50%); background-position: calc(100% - 9px) 11px,calc(100% - 6px) 11px; background-repeat: no-repeat; background-size: 3px 3px,3px 3px; color: #08090b; font: inherit; font-size: 10px; font-weight: 550; text-align: right; outline: none; box-shadow: none; cursor: pointer; }
.crm-profile-select:hover { background-color: #f2f3f5; }
.crm-profile-select:focus { background-color: #fff; box-shadow: 0 0 0 2px rgba(81,103,221,.16); }
.crm-profile-value, .crm-profile-fact strong { overflow: hidden; color: var(--hp-text); font-size: 11px; font-weight: 600; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.crm-profile-empty { padding: 18px 0; color: var(--hp-text-muted); font-size: 9px; }
.crm-profile-bottom { margin: 0; padding: 14px 18px 18px; border: 0; border-radius: 0; background: transparent; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.crm-profile-bottom > span { color: #676970; font-size: 8px; }
.crm-profile-trash { height: 28px; padding: 0; border: 0; background: transparent; color: #222328; display: inline-flex; align-items: center; gap: 6px; font-size: 9px; font-weight: 550; cursor: pointer; }
.crm-profile-trash:hover { color: var(--hp-danger); }
.crm-profile-trash :is(i,svg) { width: 11px; height: 11px; }
.crm-prospect-workspace { min-width: 0; min-height: 0; background: #f7f9fc; display: flex; flex-direction: column; }
.crm-workbar { min-height: 68px; padding: 0 26px; border-bottom: 1px solid var(--hp-border-subtle); background: rgba(255,255,255,.92); display: flex; align-items: center; gap: 18px; backdrop-filter: blur(14px); }
.crm-sidecar-tabs { min-width: 0; height: 68px; display: flex; align-items: stretch; gap: 26px; }
.crm-sidecar-tab { position: relative; padding: 0; border: 0; background: transparent; color: var(--hp-text-muted); font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.crm-sidecar-tab:hover { color: var(--hp-text-secondary); }
.crm-sidecar-tab.active { color: var(--hp-text); }
.crm-sidecar-tab.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--hp-accent); }
.crm-open-record { margin-left: auto; padding: 0; border: 0; background: transparent; color: #222328; display: inline-flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 550; white-space: nowrap; cursor: pointer; }
.crm-open-record:hover { color: var(--hp-accent); }
.crm-open-record :is(i,svg) { width: 11px; height: 11px; }
.crm-sidecar-body { flex: 1; min-height: 0; overflow-y: auto; background: #f7f9fc; scrollbar-width: thin; }
.crm-work-overview { min-height: 100%; }
.crm-next-row { min-height: 104px; margin: 18px; padding: 20px 22px; border: 1px solid #dce6fa; border-radius: var(--hp-radius-lg); background: linear-gradient(135deg,#f4f8ff,#eef4ff); box-shadow: 0 10px 24px -16px rgba(53,109,243,.34); display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 15px; }
.crm-next-icon { width: 46px; height: 46px; border-radius: 15px; background: rgba(255,255,255,.72); color: var(--hp-accent); box-shadow: inset 0 0 0 1px rgba(53,109,243,.08); display: inline-flex; align-items: center; justify-content: center; }
.crm-next-icon :is(i,svg) { width: 14px; height: 14px; }
.crm-next-copy { min-width: 0; }
.crm-next-copy > span { display: block; color: #55575d; font-size: 9px; font-weight: 550; letter-spacing: 0; }
.crm-next-copy > strong { display: block; margin-top: 4px; overflow: hidden; color: var(--hp-text); font-size: 17px; font-weight: var(--hp-weight-strong); letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.crm-next-copy > small { display: block; margin-top: 4px; color: var(--hp-text-secondary); font-size: 11px; font-weight: 500; }
.crm-primary-action { height: 38px; padding: 0 14px; border: 1px solid var(--hp-accent); border-radius: var(--hp-radius-md); background: linear-gradient(180deg,#477cf5,var(--hp-accent)); color: #fff; box-shadow: 0 8px 18px -8px rgba(53,109,243,.72); display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 11px; font-weight: 650; cursor: pointer; }
.crm-primary-action:hover { border-color: var(--hp-accent-hover); background: var(--hp-accent-hover); }
.crm-primary-action :is(i,svg) { width: 11px; height: 11px; }
.crm-demo-chat-message { display: flex; align-items: flex-start; gap: 10px; }
.crm-demo-chat-avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: linear-gradient(135deg,#6d5ce7,#4276ec); color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 5px 12px -8px rgba(66,82,210,.8); }
.crm-demo-chat-avatar :is(i,svg) { width: 14px; height: 14px; }
.crm-demo-chat-content { min-width: 0; flex: 1; }
.crm-demo-chat-meta { min-height: 22px; margin-bottom: 4px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.crm-demo-chat-meta > strong { color: var(--ds-gray-800); font-size: 13px; font-weight: 650; }
.crm-demo-chat-meta > span { padding: 2px 6px; border-radius: 4px; background: rgba(91,86,214,.09); color: #5954c9; display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 620; }
.crm-demo-chat-meta > span :is(i,svg) { width: 10px; height: 10px; }
.crm-demo-chat-meta > time { color: var(--ds-gray-400); font-size: 11px; }
.crm-demo-chat-bubble { max-width: 100%; padding: 12px 14px 13px; border: 1px solid #e0e6f4; border-radius: 4px 14px 14px 14px; background: #f7f8fd; color: #111216; box-shadow: 0 8px 18px -18px rgba(53,70,160,.72); }
.crm-demo-chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.crm-demo-chat-head > div:first-child { min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; }
.crm-demo-chat-head > div:first-child > strong { color: #17191e; font-size: 11px; font-weight: 650; }
.crm-demo-chat-head > div:first-child > span { color: #626775; font-size: 9px; }
.crm-demo-intelligence-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.crm-demo-intelligence-actions button { height: 26px; padding: 0 8px; border: 1px solid #d4dfef; border-radius: 6px; background: rgba(255,255,255,.72); color: #1e2a3c; display: inline-flex; align-items: center; gap: 5px; font-size: 8.5px; font-weight: 560; cursor: pointer; }
.crm-demo-intelligence-actions button:hover { border-color: #aebfe0; background: #fff; color: var(--hp-accent); }
.crm-demo-intelligence-actions :is(i,svg) { width: 10px; height: 10px; }
.crm-demo-chat-bubble > p { margin: 10px 0 0; color: #20232b; font-size: 12px; font-weight: 470; line-height: 1.58; }
.crm-demo-chat-bubble > p.crm-demo-processing { color: #3e4149; }
.crm-transcript-review-dialog { width: min(900px,calc(100vw - 28px)); padding: 0; overflow: hidden; }
.crm-transcript-review-head { min-height: 76px; padding: 18px 22px; border-bottom: 1px solid var(--ds-gray-200); display: grid; grid-template-columns: 40px minmax(0,1fr) 34px; align-items: center; gap: 12px; }
.crm-transcript-review-head > span { width: 40px; height: 40px; border: 1px solid #cbd5e1; border-radius: 10px; color: #334155; display: inline-flex; align-items: center; justify-content: center; }
.crm-transcript-review-head > span :is(i,svg) { width: 19px; height: 19px; }
.crm-transcript-review-head h2 { margin: 0; font-size: 17px; }
.crm-transcript-review-head p { margin: 3px 0 0; color: var(--ds-gray-500); font-size: 11px; }
.crm-transcript-review-head > button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ds-gray-500); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.crm-transcript-review-head > button:hover { background: var(--ds-gray-100); color: var(--ds-gray-800); }
.crm-transcript-review-head > button :is(i,svg) { width: 17px; height: 17px; }
.crm-transcript-review-rule { margin: 18px 22px 14px; padding: 11px 13px; border: 1px solid #f59e0b; border-left-width: 3px; border-radius: 8px; background: #fff; }
.crm-transcript-review-rule strong { color: #78350f; font-size: 11px; }
.crm-transcript-review-rule p { margin: 3px 0 0; color: #6b4f2d; font-size: 11px; line-height: 1.45; }
.crm-transcript-review-label { margin: 0 22px 6px; }
#crmTranscriptReviewText { display: block; width: calc(100% - 44px); min-height: 300px; max-height: 43vh; margin: 0 22px; resize: vertical; border: 1px solid var(--ds-gray-200); border-radius: 9px; background: #fff; color: #1f2937; font: 11px/1.55 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; }
.crm-transcript-review-help { margin: 6px 22px 0; color: var(--ds-gray-500); font-size: 10px; }
.crm-transcript-review-checks { margin: 16px 22px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.crm-transcript-review-checks label { min-height: 64px; margin: 0; padding: 11px; border: 1px solid var(--ds-gray-200); border-radius: 9px; background: #fff; display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.crm-transcript-review-checks input { width: 16px!important; height: 16px; margin: 2px 0 0; flex: 0 0 16px; accent-color: var(--ds-primary); }
.crm-transcript-review-checks span { min-width: 0; }
.crm-transcript-review-checks strong { display: block; color: var(--ds-gray-800); font-size: 11px; }
.crm-transcript-review-checks small { display: block; margin-top: 3px; color: var(--ds-gray-500); font-size: 10px; line-height: 1.35; }
.crm-transcript-review-dialog > .sa-modal-actions { margin: 18px 22px 22px; }
.crm-demo-insights { margin-top: 11px; border-top: 1px solid #e0e7f1; }
.crm-demo-insight-row { min-height: 31px; padding: 7px 0; border-bottom: 1px solid #e0e7f1; display: grid; grid-template-columns: 82px minmax(0,1fr); align-items: start; gap: 10px; }
.crm-demo-insight-row > span { padding-top: 2px; color: #50535b; font-size: 10px; font-weight: 560; }
.crm-demo-insight-row > div { display: flex; flex-wrap: wrap; gap: 4px 10px; color: #111216; font-size: 11px; line-height: 1.45; }
.crm-demo-insight-row em { position: relative; padding-left: 9px; color: #17191e; font-style: normal; }
.crm-demo-insight-row em::before { content: ""; position: absolute; top: .58em; left: 0; width: 3px; height: 3px; border-radius: 50%; background: #7392cc; }
.crm-demo-insight-row b { padding: 2px 6px; border-radius: 999px; background: #edf1f6; color: #333943; font-size: 9px; font-weight: 620; }
.crm-demo-insight-row b.is-high { background: var(--hp-success-soft); color: var(--hp-success); }
.crm-demo-insight-row b.is-medium { background: var(--hp-warning-soft); color: var(--hp-warning); }
.crm-demo-insight-row b.is-low { background: var(--hp-danger-soft); color: var(--hp-danger); }
.crm-demo-followup { margin-top: 9px; color: #272a31; font-size: 11px; }
.crm-demo-followup summary { width: max-content; color: var(--hp-accent); font-weight: 580; cursor: pointer; }
.crm-demo-followup > div { max-width: 820px; margin-top: 7px; padding-left: 12px; border-left: 2px solid #d5e2f7; white-space: pre-wrap; line-height: 1.55; }
.crm-work-section { margin: 0 18px 18px; padding: 24px 26px 28px; border: 1px solid var(--hp-border-subtle); border-radius: var(--hp-radius-lg); background: rgba(255,255,255,.94); box-shadow: var(--hp-shadow-xs); }
.crm-work-section-full { min-height: 100%; }
.crm-work-section-head { min-height: 40px; margin-bottom: 7px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.crm-work-section-title { color: var(--hp-text); font-size: 18px; font-weight: var(--hp-weight-strong); letter-spacing: -.03em; }
.crm-work-section-copy { margin-top: 4px; color: var(--hp-text-muted); font-size: 11px; font-weight: 500; }
.crm-text-action { padding: 3px 0; border: 0; background: transparent; color: var(--hp-accent); display: inline-flex; align-items: center; gap: 4px; font-size: 9px; font-weight: 600; cursor: pointer; }
.crm-text-action :is(i,svg) { width: 10px; height: 10px; }
.crm-sidecar-timeline { position: relative; display: flex; flex-direction: column; }
.crm-sidecar-event { position: relative; min-height: 78px; padding: 15px 0; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: start; gap: 12px; }
.crm-sidecar-event + .crm-sidecar-event { border-top: 1px solid var(--hp-border-subtle); }
.crm-sidecar-event-icon { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 12px; background: #eef2f7; color: #607086; display: inline-flex; align-items: center; justify-content: center; }
.crm-sidecar-event-icon.type-call { background: #f1ecff; color: #7356c8; }
.crm-sidecar-event-icon.type-meeting { background: #e9f7f2; color: #21805b; }
.crm-sidecar-event-icon.type-email { background: #fff3e5; color: #a96216; }
.crm-sidecar-event-icon.type-demo { background: #eaf6fb; color: #367fa2; }
.crm-sidecar-event-icon :is(i,svg) { width: 11px; height: 11px; }
.crm-sidecar-event-content { min-width: 0; }
.crm-sidecar-event-title { color: var(--hp-text); font-size: 12px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.crm-sidecar-event.compact .crm-sidecar-event-title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.crm-sidecar-event-meta { margin-top: 4px; color: #3f4046; font-size: 8.5px; }
.crm-sidecar-event-time { padding-top: 3px; color: #5b5d65; font-size: 8.5px; white-space: nowrap; }
.crm-sidecar-event-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.crm-event-actions { display: inline-flex; align-items: center; gap: 5px; }
.crm-event-done, .crm-event-edit { height: 24px; padding: 0 7px; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-sm); background: var(--hp-surface); color: var(--hp-text-secondary); display: inline-flex; align-items: center; gap: 4px; font-size: 8px; font-weight: 650; cursor: pointer; }
.crm-event-done:hover, .crm-event-edit:hover { border-color: #b6caf8; color: var(--hp-accent); }
.crm-event-done :is(i,svg), .crm-event-edit :is(i,svg) { width: 9px; height: 9px; }
.crm-message-stream { padding-top: 10px; }
.crm-sidecar-message { max-width: 78%; margin-bottom: 12px; }
.crm-sidecar-message.out { margin-left: auto; }
.crm-sidecar-message-body { padding: 11px 13px; border: 1px solid var(--hp-border-subtle); border-radius: 16px 16px 16px 6px; background: #f7f9fb; color: var(--hp-text-secondary); font-size: 10px; line-height: 1.5; box-shadow: var(--hp-shadow-xs); }
.crm-sidecar-message.out .crm-sidecar-message-body { border-color: #d9e6ff; border-radius: 16px 16px 6px 16px; background: #edf4ff; color: #2c4f87; }
.crm-sidecar-message-meta { margin-top: 4px; color: var(--hp-text-faint); font-size: 7px; }
.crm-sidecar-message.out .crm-sidecar-message-meta { text-align: right; }
.crm-sidecar-empty { padding: 52px 16px; color: var(--hp-text-muted); text-align: center; font-size: 9px; }

/* Cal.com booking flow: one focused surface, compact slots, no exposed credentials. */
.crm-calcom-overlay { z-index: 10080; background: rgba(10,16,28,.48); }
.crm-calcom-dialog { width: min(720px, calc(100vw - 32px)); max-width: none; max-height: min(760px, calc(100vh - 32px)); padding: 0; overflow: hidden; border: 1px solid #dfe3ea; border-radius: var(--hp-radius-xl); background: #fff; box-shadow: var(--hp-shadow-popover); }
.crm-calcom-header { min-height: 104px; padding: 22px 26px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.crm-calcom-eyebrow { color: #2f6fed; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; }
.crm-calcom-eyebrow :is(i,svg) { width: 14px; height: 14px; }
.crm-calcom-header h2 { margin: 8px 0 0; color: #0a0b0e; font-size: 24px; font-weight: 650; letter-spacing: -.025em; }
.crm-calcom-header p { margin: 5px 0 0; color: #52545b; font-size: 12px; line-height: 1.4; }
.crm-calcom-close { width: 36px; height: 36px; padding: 0; border: 1px solid #e0e3e8; border-radius: var(--hp-radius-md); background: #fff; color: #17191e; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.crm-calcom-close:hover { background: #f4f5f7; }
.crm-calcom-close :is(i,svg) { width: 16px; height: 16px; }
.crm-calcom-tabs { height: 48px; padding: 0 26px; border-top: 1px solid #eef0f3; border-bottom: 1px solid #e4e7ec; display: flex; align-items: stretch; gap: 24px; }
.crm-calcom-tabs button { position: relative; padding: 0; border: 0; background: transparent; color: #555861; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 560; cursor: pointer; }
.crm-calcom-tabs button.active { color: #111216; }
.crm-calcom-tabs button.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: #2f6fed; }
.crm-calcom-tabs :is(i,svg) { width: 14px; height: 14px; }
.crm-calcom-body { min-height: 410px; max-height: calc(100vh - 206px); overflow-y: auto; background: #fbfbfc; }
.crm-calcom-existing { min-height: 58px; padding: 11px 26px; border-bottom: 1px solid #d9e5fc; background: #eef4ff; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.crm-calcom-existing > :is(i,svg) { width: 18px; height: 18px; color: #2f6fed; }
.crm-calcom-existing span, .crm-calcom-context span, .crm-calcom-bookbar span, .crm-calcom-recipient span { display: block; color: #555861; font-size: 10px; }
.crm-calcom-existing strong, .crm-calcom-context strong, .crm-calcom-bookbar strong, .crm-calcom-recipient strong { display: block; margin-top: 2px; color: #0c0d10; font-size: 12px; font-weight: 620; }
.crm-calcom-existing a { color: #245ecf; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 620; text-decoration: none; }
.crm-calcom-existing a :is(i,svg) { width: 12px; height: 12px; }
.crm-calcom-context { min-height: 62px; padding: 12px 26px; border-bottom: 1px solid #e6e8ec; background: #f5f6f8; display: flex; align-items: center; gap: 56px; }
.crm-calcom-slot-list { max-height: 326px; overflow-y: auto; padding: 0 26px; background: #fff; }
.crm-calcom-day { min-height: 58px; padding: 11px 0; border-bottom: 1px solid #eceef1; display: grid; grid-template-columns: 94px minmax(0,1fr); align-items: start; gap: 12px; }
.crm-calcom-day:last-child { border-bottom: 0; }
.crm-calcom-day-label { padding-top: 8px; color: #202126; font-size: 11px; font-weight: 620; }
.crm-calcom-times { display: flex; flex-wrap: wrap; gap: 7px; }
.crm-calcom-times button { min-width: 66px; height: 36px; padding: 0 11px; border: 1px solid #d9dde4; border-radius: var(--hp-radius-sm); background: #fff; color: #181a1f; font-size: 11px; font-weight: 540; cursor: pointer; }
.crm-calcom-times button:hover { border-color: #8baff5; background: #f5f8ff; }
.crm-calcom-times button.selected { border-color: #2f6fed; background: #2f6fed; color: #fff; box-shadow: 0 3px 10px rgba(47,111,237,.2); }
.crm-calcom-no-slots { padding: 80px 16px; color: #555861; text-align: center; font-size: 12px; }
.crm-calcom-bookbar { min-height: 70px; padding: 12px 26px; border-top: 1px solid #e1e4e9; background: #f7f8fa; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.crm-calcom-actions { margin-top: 24px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.crm-calcom-primary, .crm-calcom-secondary { min-height: 42px; padding: 0 16px; border-radius: var(--hp-radius-md); display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 620; cursor: pointer; }
.crm-calcom-primary { border: 1px solid #2f6fed; background: #2f6fed; color: #fff; }
.crm-calcom-primary:hover:not(:disabled) { border-color: #205bcf; background: #205bcf; }
.crm-calcom-primary:disabled { border-color: #bdc8dc; background: #bdc8dc; cursor: not-allowed; }
.crm-calcom-secondary { border: 1px solid #d7dbe2; background: #fff; color: #1c1e23; }
.crm-calcom-secondary:hover { border-color: #b6becb; background: #f7f8fa; }
.crm-calcom-primary :is(i,svg), .crm-calcom-secondary :is(i,svg) { width: 14px; height: 14px; }
.crm-calcom-inline-note { padding: 9px 26px; border-top: 1px solid #ead8aa; background: #fff9ea; color: #664b0a; display: flex; align-items: center; gap: 7px; font-size: 10px; }
.crm-calcom-inline-note :is(i,svg) { width: 13px; height: 13px; }
.crm-calcom-link-panel { padding: 26px; }
.crm-calcom-section-title { color: #0b0c0f; font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
.crm-calcom-link-panel > p { max-width: 560px; margin: 7px 0 20px; color: #4c4f57; font-size: 12px; line-height: 1.55; }
.crm-calcom-link-row { min-height: 52px; border: 1px solid #d9dde4; border-radius: var(--hp-radius-md); background: #fff; display: flex; align-items: center; overflow: hidden; }
.crm-calcom-link-row span { flex: 1; min-width: 0; padding: 0 14px; overflow: hidden; color: #22242a; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.crm-calcom-link-row button { width: 46px; align-self: stretch; border: 0; border-left: 1px solid #e2e5ea; background: #f6f7f9; color: #25272d; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.crm-calcom-link-row button:hover { background: #edf2fc; color: #2f6fed; }
.crm-calcom-link-row :is(i,svg) { width: 15px; height: 15px; }
.crm-calcom-recipient { margin-top: 16px; padding: 12px 2px; display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: center; gap: 9px; }
.crm-calcom-recipient > :is(i,svg) { width: 16px; height: 16px; color: #44474f; }
.crm-calcom-loading, .crm-calcom-unavailable { min-height: 360px; padding: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #181a1f; text-align: center; }
.crm-calcom-loading strong, .crm-calcom-unavailable strong { margin-top: 14px; font-size: 13px; font-weight: 620; }
.crm-calcom-loading small, .crm-calcom-unavailable p { margin-top: 6px; color: #5b5e66; font-size: 11px; }
.crm-calcom-unavailable > :is(i,svg) { width: 28px; height: 28px; color: #69707d; }
.crm-calcom-unavailable .crm-calcom-secondary { margin-top: 16px; }
.crm-calcom-spinner { width: 22px; height: 22px; border: 2px solid #d8e3f8; border-top-color: #2f6fed; border-radius: 50%; animation: crm-calcom-spin .7s linear infinite; }
.crm-calcom-spinner.small { width: 14px; height: 14px; border-color: rgba(255,255,255,.4); border-top-color: #fff; }
@keyframes crm-calcom-spin { to { transform: rotate(360deg); } }
.crm-next-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.crm-secondary-action { height: 30px; padding: 0 9px; border: 1px solid #d4d8df; border-radius: var(--hp-radius-sm); background: #fff; color: #25272c; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 8.5px; font-weight: 570; text-decoration: none; cursor: pointer; }
.crm-secondary-action:hover { border-color: #adc3ef; color: #2f6fed; }
.crm-secondary-action :is(i,svg) { width: 10px; height: 10px; }

/*
 * Button contract
 *
 * Action hierarchy changes color and emphasis, never geometry. Primary,
 * secondary, ghost and danger actions share one 42/36px scale, one radius,
 * one label weight and one icon scale. Tabs, chips, swatches and editor tools
 * are separate controls and deliberately stay outside this contract.
 */
.hp-button,
:is(.btn-gradient,.btn-gradient-success,.btn-gradient-danger,.btn-secondary,.btn-ghost,.crm-primary-action,.crm-secondary-action,.crm-calcom-primary,.crm-calcom-secondary) {
  box-sizing: border-box;
  height: var(--hp-button-height-md);
  min-height: var(--hp-button-height-md);
  padding: 0 var(--hp-button-padding-md);
  border-radius: var(--hp-button-radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--hp-font-md);
  font-weight: var(--hp-weight-semibold);
  line-height: 1;
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--hp-transition),border-color var(--hp-transition),color var(--hp-transition),box-shadow var(--hp-transition),transform var(--hp-transition);
}
.hp-button--primary,
:is(.btn-gradient,.crm-primary-action,.crm-calcom-primary) {
  border: 1px solid #2f66e7;
  background: linear-gradient(180deg,#477cf5 0%,var(--hp-accent) 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2),0 8px 18px -8px rgba(53,109,243,.72);
}
.hp-button--primary:hover:not(:disabled),
:is(.btn-gradient,.crm-primary-action,.crm-calcom-primary):hover:not(:disabled) {
  border-color: var(--hp-accent-hover);
  background: linear-gradient(180deg,#3d72e9 0%,var(--hp-accent-hover) 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18),0 12px 24px -10px rgba(39,91,215,.75);
  transform: translateY(-1px);
}
.hp-button--secondary,
:is(.btn-secondary,.crm-secondary-action,.crm-calcom-secondary) {
  border: 1px solid var(--hp-border);
  background: rgba(255,255,255,.94);
  color: var(--hp-text-secondary);
  box-shadow: var(--hp-shadow-xs);
}
.hp-button--secondary:hover:not(:disabled),
:is(.btn-secondary,.crm-secondary-action,.crm-calcom-secondary):hover:not(:disabled) {
  border-color: var(--hp-border-strong);
  background: var(--hp-surface);
  color: var(--hp-text);
  box-shadow: var(--hp-shadow-sm);
  transform: translateY(-1px);
}
.hp-button--success,
.btn-gradient-success { border: 1px solid var(--hp-success); background: var(--hp-success); color: #fff; box-shadow: none; }
.hp-button--danger,
.btn-gradient-danger { border: 1px solid var(--hp-danger); background: var(--hp-danger); color: #fff; box-shadow: none; }
.hp-button--ghost,
.btn-ghost { border: 1px solid transparent; background: transparent; color: var(--hp-text-muted); box-shadow: none; }
.hp-button--ghost:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) { background: var(--hp-surface-hover); color: var(--hp-text); }
.hp-button :is(i,svg),
:is(.btn-gradient,.btn-gradient-success,.btn-gradient-danger,.btn-secondary,.btn-ghost,.crm-primary-action,.crm-secondary-action,.crm-calcom-primary,.crm-calcom-secondary) :is(i,svg) {
  width: var(--hp-button-icon-md);
  height: var(--hp-button-icon-md);
  flex: 0 0 auto;
}
.hp-button--sm,
:is(.btn-gradient,.btn-gradient-success,.btn-gradient-danger,.btn-secondary,.btn-ghost).btn-sm,
:is(.sales-icon-button,.wa-msg-new-email,.wa-msg-open-lead,.wa-msg-icon-btn) {
  height: var(--hp-button-height-sm);
  min-height: var(--hp-button-height-sm);
  padding-right: var(--hp-button-padding-sm);
  padding-left: var(--hp-button-padding-sm);
  border-radius: var(--hp-button-radius-sm);
  gap: 6px;
  font-size: var(--hp-font-sm);
}
.hp-button--sm :is(i,svg),
:is(.btn-gradient,.btn-gradient-success,.btn-gradient-danger,.btn-secondary,.btn-ghost).btn-sm :is(i,svg),
:is(.sales-icon-button,.wa-msg-new-email,.wa-msg-open-lead,.wa-msg-icon-btn) :is(i,svg) {
  width: var(--hp-button-icon-sm);
  height: var(--hp-button-icon-sm);
}
.hp-button--icon { width: var(--hp-button-height-md); padding: 0; }
.hp-button--sm.hp-button--icon { width: var(--hp-button-height-sm); padding: 0; }
.hp-button:disabled,
:is(.btn-gradient,.btn-gradient-success,.btn-gradient-danger,.btn-secondary,.btn-ghost,.crm-primary-action,.crm-secondary-action,.crm-calcom-primary,.crm-calcom-secondary):disabled {
  opacity: .46;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.sa-login-card .btn-gradient { height: var(--hp-button-height-lg); min-height: var(--hp-button-height-lg); }
.sa-header-user > .btn-secondary { height: var(--hp-button-height-sm); min-height: var(--hp-button-height-sm); }
.crm-next-actions { gap: 8px; }

/* Sales Inbox: the same dense, neutral workspace language as the CRM sidecar. */
.sa-app[data-page="wa-messenger"] .sa-content { padding: 24px 28px 28px; }
.sa-app[data-page="wa-messenger"] .wa-msg-layout { height: calc(100vh - 120px); min-height: 600px; grid-template-columns: 400px minmax(0,1fr); gap: 16px; }
.sa-app[data-page="wa-messenger"] .wa-msg-left,
.sa-app[data-page="wa-messenger"] .wa-msg-thread { overflow: hidden; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-xl); background: var(--hp-surface); box-shadow: var(--hp-shadow-sm); }
.sa-app[data-page="wa-messenger"] .wa-msg-head { min-height: 82px; padding: 16px 18px; border-color: var(--hp-border-subtle); }
.sa-app[data-page="wa-messenger"] .wa-msg-head > div:first-child > div:first-child { color: var(--hp-text) !important; font-size: var(--hp-font-lg) !important; font-weight: var(--hp-weight-strong) !important; }
.sa-app[data-page="wa-messenger"] .wa-msg-head > div:first-child > div:last-child { color: var(--hp-text-muted) !important; font-size: var(--hp-font-sm) !important; }
.sa-app[data-page="wa-messenger"] .wa-msg-new-email { height: var(--hp-control-sm); padding: 0 10px; border: 1px solid var(--hp-accent); border-radius: var(--hp-radius-md); background: var(--hp-accent); font-size: var(--hp-font-sm); font-weight: var(--hp-weight-semibold); }
.sa-app[data-page="wa-messenger"] .wa-msg-search { margin: 12px 16px 10px; }
.sa-app[data-page="wa-messenger"] .wa-msg-search input { height: var(--hp-control-md); border-color: var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface); color: var(--hp-text); font-size: var(--hp-font-md); }
.sa-app[data-page="wa-messenger"] .wa-msg-search input:focus { border-color: var(--hp-blue-300); background: var(--hp-surface); box-shadow: 0 0 0 3px rgba(47,111,237,.08); }
.sa-app[data-page="wa-messenger"] .wa-msg-filters { gap: 6px; padding: 0 16px 12px; }
.sa-app[data-page="wa-messenger"] .wa-msg-filter { min-height: 28px; padding: 0 8px; border-color: var(--hp-border); border-radius: var(--hp-radius-pill); background: var(--hp-surface); color: var(--hp-text-muted); font-size: var(--hp-font-xs); font-weight: var(--hp-weight-medium); }
.sa-app[data-page="wa-messenger"] .wa-msg-filter strong { color: var(--hp-text-faint); font-size: var(--hp-font-2xs); }
.sa-app[data-page="wa-messenger"] .wa-msg-filter.active { border-color: var(--hp-accent-border); background: var(--hp-accent-soft); color: var(--hp-accent-pressed); }
.sa-app[data-page="wa-messenger"] .wa-msg-filter.active strong { color: var(--hp-accent); }
.sa-app[data-page="wa-messenger"] .wa-msg-list { border-color: var(--hp-border-subtle); }
.sa-app[data-page="wa-messenger"] .wa-msg-row { min-height: 82px; padding: 12px 14px; grid-template-columns: 40px minmax(0,1fr); gap: 11px; border-color: var(--hp-border-subtle); background: var(--hp-surface); }
.sa-app[data-page="wa-messenger"] .wa-msg-row:hover { background: var(--hp-surface-hover); }
.sa-app[data-page="wa-messenger"] .wa-msg-row.unread { background: #fafcff; }
.sa-app[data-page="wa-messenger"] .wa-msg-row.active { padding-left: 11px; border-left: 3px solid var(--hp-accent); background: linear-gradient(90deg,#edf3ff,#f5f8ff); }
.sa-app[data-page="wa-messenger"] .wa-msg-avatar { width: 40px; height: 40px; border-radius: 14px; background: #edf1f6; color: #4c6077; font-size: var(--hp-font-sm); font-weight: var(--hp-weight-semibold); }
.sa-app[data-page="wa-messenger"] .wa-msg-row-title { color: var(--hp-text); font-size: var(--hp-font-md); font-weight: var(--hp-weight-semibold); }
.sa-app[data-page="wa-messenger"] .wa-msg-row.unread .wa-msg-row-title { font-weight: var(--hp-weight-strong); }
.sa-app[data-page="wa-messenger"] .wa-msg-row-time { color: var(--hp-text-faint); font-size: var(--hp-font-2xs); }
.sa-app[data-page="wa-messenger"] .wa-msg-unread { background: var(--hp-accent); font-weight: var(--hp-weight-semibold); }
.sa-app[data-page="wa-messenger"] .wa-msg-row-meta { color: var(--hp-text-muted); font-size: var(--hp-font-xs); }
.sa-app[data-page="wa-messenger"] .wa-msg-mini { padding: 2px 5px; border-radius: var(--hp-radius-xs); background: var(--hp-surface-sunken); color: var(--hp-text-muted); font-size: var(--hp-font-2xs); font-weight: var(--hp-weight-semibold); }
.sa-app[data-page="wa-messenger"] .wa-msg-mini.email { background: var(--hp-accent-soft); color: var(--hp-accent-pressed); }
.sa-app[data-page="wa-messenger"] .wa-msg-preview { margin-top: 5px; color: var(--hp-text-muted); font-size: var(--hp-font-sm); }
.sa-app[data-page="wa-messenger"] .wa-msg-thread-header { border-color: var(--hp-border-subtle); }
.sa-app[data-page="wa-messenger"] .wa-msg-thread-title { min-height: 82px; padding: 15px 20px; }
.sa-app[data-page="wa-messenger"] .wa-msg-thread-title > div:first-child > div:first-child > span:first-child { color: var(--hp-text) !important; font-size: var(--hp-font-lg) !important; font-weight: var(--hp-weight-strong) !important; }
.sa-app[data-page="wa-messenger"] .wa-msg-thread-title > div:first-child > div:nth-child(2) { color: var(--hp-text-muted) !important; font-size: var(--hp-font-sm) !important; }
.sa-app[data-page="wa-messenger"] .wa-msg-bridge { padding: 5px 8px; background: var(--hp-surface-sunken); color: var(--hp-text-muted); font-size: var(--hp-font-xs); font-weight: var(--hp-weight-medium); }
.sa-app[data-page="wa-messenger"] .wa-msg-icon-btn,
.sa-app[data-page="wa-messenger"] .wa-msg-open-lead { height: var(--hp-control-sm); border-color: var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface); color: var(--hp-text-secondary); font-size: var(--hp-font-sm); font-weight: var(--hp-weight-semibold); }
.sa-app[data-page="wa-messenger"] .wa-msg-feed { padding: 20px; background: linear-gradient(180deg,#f8fafd,#f4f7fb); gap: 12px; }
.sa-app[data-page="wa-messenger"] .wa-msg-bubble { padding: 12px 14px; border: 1px solid var(--hp-border); border-radius: 17px 17px 17px 6px; background: var(--hp-surface); color: var(--hp-text-secondary); box-shadow: var(--hp-shadow-xs); font-size: var(--hp-font-md); line-height: 1.55; }
.sa-app[data-page="wa-messenger"] .wa-msg-bubble.out { border-color: var(--hp-success-border); border-radius: 17px 17px 6px 17px; background: var(--hp-success-soft); color: #24533f; }
.sa-app[data-page="wa-messenger"] .wa-msg-bubble.email { border-color: var(--hp-accent-border); background: #f6f9ff; color: var(--hp-text-secondary); }
.sa-app[data-page="wa-messenger"] .wa-msg-bubble.out.email { border-color: var(--hp-accent-border); background: var(--hp-accent-soft); color: #243b64; }
.sa-app[data-page="wa-messenger"] .wa-msg-bubble-meta,
.sa-app[data-page="wa-messenger"] .wa-msg-bubble.out .wa-msg-bubble-meta,
.sa-app[data-page="wa-messenger"] .wa-msg-bubble.in .wa-msg-bubble-meta { color: var(--hp-text-faint); font-size: var(--hp-font-2xs); }
.sa-app[data-page="wa-messenger"] .wa-msg-bubble-ai { background: rgba(47,111,237,.08); color: var(--hp-accent-pressed); }
.sa-app[data-page="wa-messenger"] .wa-msg-mailbox-label { color: var(--hp-accent); font-weight: var(--hp-weight-semibold); }
.sa-app[data-page="wa-messenger"] .wa-msg-email-subject { border-color: var(--hp-border-subtle); color: var(--hp-text); font-size: var(--hp-font-base); font-weight: var(--hp-weight-semibold); }
.sa-app[data-page="wa-messenger"] .wa-msg-email-routing { color: var(--hp-text-muted); font-size: var(--hp-font-xs); font-weight: var(--hp-weight-medium); }
.sa-app[data-page="wa-messenger"] .wa-msg-bubble.out .wa-msg-email-routing { color: var(--hp-text-muted); }
.sa-app[data-page="wa-messenger"] .wa-msg-composer { padding: 14px 16px; border-color: var(--hp-border-subtle); background: rgba(255,255,255,.96); }
.sa-app[data-page="wa-messenger"] .wa-msg-compose-tabs { padding: 2px; border-color: var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-surface-sunken); }
.sa-app[data-page="wa-messenger"] .wa-msg-compose-tabs button { height: 27px; color: var(--hp-text-muted); font-size: var(--hp-font-sm); font-weight: var(--hp-weight-semibold); }
.sa-app[data-page="wa-messenger"] .wa-msg-compose-tabs button.active { color: var(--hp-text); box-shadow: var(--hp-shadow-xs); }
.sa-app[data-page="wa-messenger"] .wa-msg-email-fields label,
.sa-app[data-page="wa-messenger"] .wa-msg-email-editor,
.sa-app[data-page="wa-messenger"] .wa-msg-composer textarea { border-color: var(--hp-border); border-radius: var(--hp-radius-md); color: var(--hp-text); font-size: var(--hp-font-md); box-shadow: none; }
.sa-app[data-page="wa-messenger"] .wa-msg-email-fields label { min-height: var(--hp-control-md); color: var(--hp-text-muted); font-size: var(--hp-font-2xs); font-weight: var(--hp-weight-semibold); }
.sa-app[data-page="wa-messenger"] .wa-msg-email-toolbar button { border-color: var(--hp-border); border-radius: var(--hp-radius-sm); color: var(--hp-text-secondary); }
.sa-app[data-page="wa-messenger"] .wa-msg-send { width: 44px; height: 44px; border-radius: 15px; background: var(--hp-success); box-shadow: 0 10px 20px -10px rgba(40,121,86,.72); }
.sa-app[data-page="wa-messenger"] .wa-msg-send.email { background: var(--hp-accent); }

/* WhatsApp bridge uses the same facts-and-workspace split as the CRM drawer. */
.sa-app[data-page="wa-bridge"] .wa-br-grid { grid-template-columns: 380px minmax(0,1fr); gap: 18px; }
.sa-app[data-page="wa-bridge"] .wa-br-card { overflow: hidden; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-xl); background: var(--hp-surface); box-shadow: var(--hp-shadow-sm); }
.sa-app[data-page="wa-bridge"] .wa-br-card-head { min-height: 54px; padding: 0 20px; border-color: var(--hp-border-subtle); color: var(--hp-text-muted); font-size: var(--hp-font-xs); font-weight: var(--hp-weight-semibold); }
.sa-app[data-page="wa-bridge"] .wa-br-row { min-height: 46px; padding: 10px 20px; border-color: var(--hp-border-subtle); color: var(--hp-text-secondary); font-size: var(--hp-font-md); }
.sa-app[data-page="wa-bridge"] .wa-br-row-label { color: var(--hp-text-muted); }
.sa-app[data-page="wa-bridge"] .wa-br-row-value { color: var(--hp-text); font-family: var(--hp-font-mono); font-size: var(--hp-font-sm); font-weight: var(--hp-weight-medium); }
.sa-app[data-page="wa-bridge"] .wa-br-state-pill { min-height: 28px; padding: 4px 9px; border-radius: var(--hp-radius-pill); font-size: var(--hp-font-sm); font-weight: var(--hp-weight-semibold); }
.sa-app[data-page="wa-bridge"] .wa-br-state-dot { width: 7px; height: 7px; }
.sa-app[data-page="wa-bridge"] .wa-br-qr-host { min-height: 440px; padding: 36px 24px; background: linear-gradient(180deg,#fff,#fbfcff); }
.sa-app[data-page="wa-bridge"] .wa-br-qr-img { border-color: var(--hp-border); border-radius: var(--hp-radius-lg); box-shadow: var(--hp-shadow-sm); }
.sa-app[data-page="wa-bridge"] .wa-br-instr { color: var(--hp-text-secondary); font-size: var(--hp-font-md); }

/* Client onboarding document rows reuse semantic tokens rather than local colors. */
.cr-doc-gate { border-color: var(--hp-border-subtle); background: var(--hp-canvas-subtle); }
.cr-doc-gate-title, .cr-doc-name { color: var(--hp-text); font-weight: var(--hp-weight-semibold); }
.cr-doc-gate-copy, .cr-doc-meta, .cr-doc-template { color: var(--hp-text-muted); }
.cr-doc-stage, .cr-doc-row { border-color: var(--hp-border-subtle); }
.cr-doc-stage-head { color: var(--hp-text-muted); font-size: var(--hp-font-2xs); font-weight: var(--hp-weight-semibold); }
.cr-doc-state-icon { border-color: var(--hp-border); border-radius: var(--hp-radius-md); color: var(--hp-text-muted); }
.cr-doc-state-icon.verified { border-color: var(--hp-success-border); background: var(--hp-success-soft); color: var(--hp-success); }
.cr-doc-state-icon.uploaded { border-color: var(--hp-accent-border); background: var(--hp-accent-soft); color: var(--hp-accent); }
.cr-doc-state-icon.rejected { border-color: var(--hp-danger-border); background: var(--hp-danger-soft); color: var(--hp-danger); }
.cr-doc-status { min-height: 20px; padding: 2px 7px; border-radius: var(--hp-radius-sm); font-size: var(--hp-font-2xs); font-weight: var(--hp-weight-semibold); letter-spacing: 0; }
.cr-sign-panel { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 18px 20px; padding: 18px; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-lg); background: linear-gradient(145deg,#fff,#f8faff); box-shadow: var(--hp-shadow-xs); }
.cr-sign-panel.setup-required { border-color: var(--hp-warning-border); background: linear-gradient(145deg,#fffdfa,var(--hp-warning-soft)); }
.cr-sign-main { display: flex; align-items: flex-start; gap: 13px; min-width: 0; }
.cr-sign-icon, .cr-sign-modal-icon { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 1px solid var(--hp-accent-border); border-radius: var(--hp-radius-md); background: var(--hp-accent-soft); color: var(--hp-accent); }
.cr-sign-panel.setup-required .cr-sign-icon { border-color: var(--hp-warning-border); background: #fffaf0; color: var(--hp-warning); }
.cr-sign-icon svg, .cr-sign-modal-icon svg { width: 20px; height: 20px; }
.cr-sign-copy { min-width: 0; }
.cr-sign-eyebrow { margin-bottom: 3px; color: var(--hp-text-faint); font-size: var(--hp-font-2xs); font-weight: var(--hp-weight-semibold); letter-spacing: .08em; text-transform: uppercase; }
.cr-sign-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--hp-text); font-size: var(--hp-font-lg); font-weight: var(--hp-weight-strong); }
.cr-sign-description { max-width: 760px; margin-top: 6px; color: var(--hp-text-secondary); font-size: var(--hp-font-sm); line-height: 1.55; }
.cr-sign-missing { max-width: 820px; margin-top: 10px; color: var(--hp-warning); font-size: var(--hp-font-xs); line-height: 1.5; }
.cr-sign-envelope { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 11px; color: var(--hp-text-muted); font-size: var(--hp-font-xs); }
.cr-sign-envelope strong { color: var(--hp-text-secondary); }
.cr-sign-error { width: 100%; color: var(--hp-danger); }
.cr-sign-footnote { margin-top: 10px; color: var(--hp-text-faint); font-size: var(--hp-font-2xs); }
.cr-sign-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }
.cr-invoice-email-modal { width: 460px; max-width: 100%; }
.cr-invoice-email-modal .sa-modal-body { overflow-wrap: anywhere; }
.cr-invoice-email-modal .sa-modal-body > p { color: var(--hp-text-secondary); line-height: 1.55; margin: 0 0 18px; }
.cr-invoice-email-modal .sa-modal-body > .cr-sign-error { color: var(--hp-danger); }
.cr-invoice-email-modal .form-group strong { display: block; color: var(--hp-text); }
.cr-invoice-email-modal .sa-modal-actions button { min-height: 44px; }
.cr-sign-actions:has(#clientInvoiceEmailButton) button { min-height: 44px; }
.cr-invoice-delivery { overflow-wrap: anywhere; }
.cr-invoice-delivery > span { min-width: 0; }
.cr-sign-status { min-height: 22px; padding: 3px 8px; border-radius: var(--hp-radius-pill); background: var(--hp-surface-sunken); color: var(--hp-text-muted); font-size: var(--hp-font-2xs); font-weight: var(--hp-weight-semibold); text-transform: uppercase; letter-spacing: .04em; }
.cr-sign-status.ready, .cr-sign-status.completed { background: var(--hp-success-soft); color: var(--hp-success); }
.cr-sign-status.sent, .cr-sign-status.delivered, .cr-sign-status.creating { background: var(--hp-accent-soft); color: var(--hp-accent); }
.cr-sign-status.setup_required { background: var(--hp-warning-soft); color: var(--hp-warning); }
.cr-sign-status.declined, .cr-sign-status.voided, .cr-sign-status.error { background: var(--hp-danger-soft); color: var(--hp-danger); }
.cr-sign-confirm { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid var(--hp-border); border-radius: var(--hp-radius-md); background: var(--hp-canvas-subtle); color: var(--hp-text-secondary); font-size: var(--hp-font-sm); line-height: 1.5; cursor: pointer; }
.cr-sign-confirm input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--hp-accent); flex: 0 0 auto; }

/* Page modules may choose button placement, but not redefine shared sizing. */
.sales-icon-button,
.sa-app[data-page="wa-messenger"] :is(.wa-msg-new-email,.wa-msg-open-lead,.wa-msg-icon-btn) {
  height: var(--hp-button-height-sm);
  min-height: var(--hp-button-height-sm);
  border-radius: var(--hp-button-radius-sm);
}

@media (max-width: 1100px) {
  .cr-sign-panel { flex-direction: column; }
  .cr-sign-actions { width: 100%; justify-content: flex-start; }
  .sales-toolbar-top { align-items: flex-start; }
  .sales-actions { max-width: 58%; }
  .sales-board-column { min-width: 208px; width: 208px; }
  .crm-sidecar { width: min(980px, calc(100vw - 64px)); }
  .crm-prospect-layout { grid-template-columns: 276px minmax(0,1fr); }
  .copilot-ops-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sa-app[data-page="support"] #pageContent > div[style*="repeat(4,1fr)"] { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}

@media (max-width: 980px) {
  .sa-app[data-page="wa-messenger"] .wa-msg-layout { height: auto; grid-template-columns: 1fr; }
  .sa-app[data-page="wa-messenger"] .wa-msg-left { height: 420px; }
  .sa-app[data-page="wa-messenger"] .wa-msg-thread { height: 620px; }
  .sa-app[data-page="wa-bridge"] .wa-br-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sa-app { height: 100dvh; flex-direction: column; }
  .sa-sidebar { display: flex; width: 100%; height: 52px; border-right: 0; border-bottom: 1px solid rgba(0,0,0,.16); }
  .sa-sidebar-logo { display: none; }
  .sa-nav { width: 100%; padding: 8px; flex-direction: row; gap: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .sa-nav::-webkit-scrollbar { display: none; }
  .sa-nav-item { min-height: 36px; flex: 0 0 auto; padding: 8px 10px; }
  .sa-nav-item.active { box-shadow: inset 0 -2px 0 #7189f0; }
  .sa-nav-divider, .sa-nav-label { display: none; }
  .sa-main { min-height: 0; overflow: hidden; }
  .sa-app[data-page="client-request-detail"] .sa-main { overflow-y: auto; overscroll-behavior-y: contain; }
  .sa-header { min-height: 52px; padding: 8px 14px; }
  .sa-header h1 { font-size: 14px; }
  .sa-header-user { gap: 6px; }
  .sa-header-user > .btn-secondary { padding: 0 9px; }
  .sa-content { padding: 14px; }
  .sa-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sa-card:has(> .sa-table) { overflow-x: auto; }
  .sa-card > .sa-table { min-width: 640px; }
  .sa-info-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sa-info-item { min-width: 0; }
  .sa-modal { width: calc(100vw - 24px); max-width: none; padding: 20px; }
  .sa-modal .form-row { grid-template-columns: 1fr; }
  .sa-login { padding: 16px; }
  .sa-login-card { width: 100%; padding: 28px 24px; }
  .sa-app[data-page="dashboard"] .dash-hero { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sa-app[data-page="dashboard"] .dash-mini { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sa-app[data-page="dashboard"] #pageContent > div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
  .sa-app[data-page="dashboard"] .dash-hero-card { min-height: 106px; }
  .sa-app[data-page="product-health"] .sa-card:first-child > div { grid-template-columns: 1fr !important; }
  .copilot-ops-grid { grid-template-columns: 1fr; }
  .sa-app[data-page="support"] #pageContent > div[style*="repeat(4,1fr)"] { grid-template-columns: 1fr !important; }
  .sa-app[data-page="ticket-detail"] #pageContent > div[style*="grid-template-columns:300px 1fr"] { grid-template-columns: 1fr !important; }
  .sa-app[data-page="wa-messenger"] .sa-content { padding: 10px; }
  .sa-app[data-page="wa-messenger"] .wa-msg-layout { gap: 8px; }
  .sa-app[data-page="wa-messenger"] .wa-msg-left { height: 390px; }
  .sa-app[data-page="wa-messenger"] .wa-msg-thread { height: 660px; }
  .sa-app[data-page="wa-messenger"] .wa-msg-thread-title { align-items: flex-start; flex-direction: column; }
  .sa-app[data-page="wa-messenger"] .wa-msg-email-fields { grid-template-columns: 1fr; }
  .sa-app[data-page="wa-messenger"] .wa-msg-email-body { overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; }
  .sa-app[data-page="wa-messenger"] .wa-msg-email-body table { min-width: 480px; max-width: none; }
  .sa-app[data-page="wa-messenger"] .wa-msg-email-body a { overflow-wrap: normal; word-break: normal; }
  .sales-toolbar { margin: -14px -14px 0; padding: 14px 14px 0; }
  .sales-toolbar-top { align-items: stretch; flex-direction: column; }
  .sales-actions { max-width: none; justify-content: flex-start; }
  .sales-heading { font-size: 18px; }
  .sales-collection-bar { margin: 0 -14px; padding: 0 14px; }
  .sales-command-bar { align-items: stretch; flex-wrap: wrap; }
  .sales-search { flex-basis: 100%; min-width: 100%; order: -1; }
  .sales-command-spacer { display: none; }
  .sales-filter-menu { margin-left: auto; }
  .sales-filter-panel { position: fixed; top: 142px; right: 14px; left: 14px; width: auto; max-height: calc(100vh - 160px); overflow-y: auto; }
  .sales-filter-grid { grid-template-columns: 1fr; }
  .sales-board { scroll-snap-type: x proximity; }
  .sales-board-column { min-width: min(calc(100vw - 42px), 340px); width: min(calc(100vw - 42px), 340px); max-height: none; scroll-snap-align: start; }
  .sales-summary-grid { grid-template-columns: 1fr 1fr; }
  .sales-today-layout { grid-template-columns: 1fr; }
  .crm-sidecar { top: 0; right: 0; bottom: 0; left: 0; width: 100vw; border: 0; border-radius: 0; }
  .crm-sidecar-close { top: 12px; right: 12px; left: auto; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: none; }
  .crm-prospect-layout { display: block; overflow-y: auto; border-radius: 0; }
  .crm-prospect-profile { overflow: visible; border-right: 0; border-bottom: 1px solid var(--hp-border-subtle); }
  .crm-profile-identity { padding-right: 58px; }
  .crm-profile-more { display: none; }
  .crm-prospect-workspace { min-height: 560px; }
  .crm-workbar { position: sticky; z-index: 2; top: 0; min-height: 52px; padding: 0 14px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); }
  .crm-sidecar-tabs { height: 52px; gap: 16px; }
  .crm-open-record { display: none; }
  .crm-sidecar-body { flex: none; overflow: visible; }
  .crm-next-row { margin: 0; padding: 16px 14px; grid-template-columns: 34px minmax(0,1fr); }
  .crm-next-row .crm-primary-action { grid-column: 2; justify-self: start; }
  .crm-demo-chat-head { flex-direction: column; gap: 8px; }
  .crm-demo-intelligence-actions { justify-content: flex-start; }
  .crm-demo-insight-row { grid-template-columns: 68px minmax(0,1fr); }
  .crm-transcript-review-dialog { width: 100vw; max-width: none; min-height: 100vh; border-radius: 0; overflow-y: auto; }
  .crm-transcript-review-checks { grid-template-columns: 1fr; }
  #crmTranscriptReviewText { min-height: 42vh; max-height: none; }
  .crm-work-section { margin: 0; padding: 18px 14px 22px; }
  .sales-card-config { grid-template-columns: 1fr; }
  .crm-calcom-dialog { width: 100vw; max-height: 100vh; height: 100vh; border: 0; border-radius: 0; }
  .crm-calcom-header { padding: 18px 18px 14px; }
  .crm-calcom-header h2 { font-size: 20px; }
  .crm-calcom-tabs { padding: 0 18px; gap: 20px; }
  .crm-calcom-body { max-height: calc(100vh - 170px); }
  .crm-calcom-context, .crm-calcom-slot-list, .crm-calcom-bookbar, .crm-calcom-link-panel { padding-right: 18px; padding-left: 18px; }
  .crm-calcom-context { gap: 24px; }
  .crm-calcom-day { grid-template-columns: 76px minmax(0,1fr); }
  .crm-calcom-bookbar { align-items: stretch; flex-direction: column; }
  .crm-calcom-bookbar .crm-calcom-primary { width: 100%; }
  .crm-next-row { grid-template-columns: 34px minmax(0,1fr); }
  .crm-next-actions { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .sa-nav-item-label { max-width: 126px; }
  .sa-stats, .sa-info-grid { grid-template-columns: 1fr; }
  .sa-app[data-page="dashboard"] .dash-hero,
  .sa-app[data-page="dashboard"] .dash-mini,
  .sales-summary-grid { grid-template-columns: 1fr; }
  .next-activity-types { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .crm-next-actions { grid-column: 1 / -1; }
}

/* Uploaded agreements: page form and signature progress share a neutral surface. */
.cr-sign-panel.cr-uploaded-agreement { background: var(--hp-surface, #fff); }
.cr-uploaded-agreement .cr-sign-copy { min-width: 0; }
.cr-uploaded-agreement .cr-sign-envelope { overflow-wrap: anywhere; }
.cr-uploaded-agreement-form { margin-top: 16px; }
.cr-uploaded-agreement-form .form-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.cr-uploaded-agreement-form .form-group { min-width: 0; }
.cr-uploaded-agreement-form input:not([type=checkbox]) { min-height: 44px; width: 100%; }
.cr-uploaded-agreement .cr-sign-confirm { margin-top: 12px; min-height: 44px; background: #fff; }
.cr-uploaded-agreement .cr-sign-actions button { min-height: 44px; }
.cr-sign-status.prepared { color: var(--hp-text-secondary); border-color: var(--hp-border); background: #fff; }
@media (max-width: 600px) {
  .cr-uploaded-agreement-form .form-row { grid-template-columns: 1fr; }
  .cr-uploaded-agreement { margin: 12px; padding: 12px; }
  .cr-uploaded-agreement .cr-sign-main { width: 100%; min-width: 0; }
  .cr-uploaded-agreement .cr-sign-actions { display: grid; grid-template-columns: 1fr; }
  .cr-uploaded-agreement .cr-sign-actions button { width: 100%; }
}

/* Per-recipient signature evidence stays readable beside the agreement. */
.cr-sign-panel:has(.cr-signer-progress) { background: #fff; }
.cr-signer-progress { margin-top: 14px; border-top: 1px solid var(--hp-border); }
.cr-signer-next { padding-top: 12px; font-size: var(--hp-font-xs); font-weight: var(--hp-weight-semibold); color: var(--hp-text-secondary); overflow-wrap: anywhere; }
.cr-signer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 12px 0; border-bottom: 1px solid var(--hp-border); }
.cr-signer-identity, .cr-signer-state { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: var(--hp-font-xs); }
.cr-signer-identity { overflow-wrap: anywhere; }
.cr-signer-identity span, .cr-signer-state small { color: var(--hp-text-muted); }
.cr-signer-state { align-items: flex-end; flex-shrink: 0; }
.cr-sign-status.in_progress, .cr-sign-status.awaiting_client, .cr-sign-status.awaiting_horex, .cr-sign-status.awaiting_signers, .cr-sign-status.finalizing { background: var(--hp-accent-soft); color: var(--hp-accent); }
@media (max-width: 640px) {
  .cr-signer-row { align-items: flex-start; flex-direction: column; }
  .cr-signer-state { align-items: flex-start; }
  .cr-signer-state .cr-sign-status { white-space: normal; }
}
/* ChatGPT pilot reuses the AI Usage card surface. */
.chatgpt-plugin-panel .sa-card-header { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.chatgpt-plugin-heading { display:flex; align-items:center; gap:12px; }
.chatgpt-plugin-heading p { margin:4px 0 0; color:var(--hp-text-secondary); font-size:12px; }
.chatgpt-plugin-icon { width:40px; height:40px; border-radius:10px; display:grid; place-items:center; background:#eff6ff; color:#2563eb; flex:none; }
.chatgpt-plugin-icon svg { width:20px; height:20px; }
.chatgpt-plugin-body { padding:16px 18px; }
.chatgpt-plugin-body p { color:var(--hp-text-secondary); font-size:13px; line-height:1.6; margin:0 0 10px; }
.chatgpt-plugin-body label { display:block; color:var(--hp-text-secondary); font-size:12px; margin-top:14px; }
.chatgpt-plugin-body code { display:block; margin:6px 0 16px; overflow-wrap:anywhere; font-size:13px; }
.chatgpt-plugin-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.chatgpt-plugin-actions .btn-gradient, .chatgpt-plugin-actions .btn-secondary { min-height:44px; display:inline-flex; align-items:center; justify-content:center; gap:8px; text-decoration:none; }
.chatgpt-plugin-actions svg { width:16px; height:16px; }
@media(max-width:480px) { .chatgpt-plugin-actions>* { width:100%; } }
