:root {
  --bg: #f6f9fc;
  --bg-strong: #e9eff6;
  --surface: rgba(255, 255, 255, 0.97);
  --menu-surface: #16263d;
  --surface-soft: #f8fbfe;
  --surface-muted: #edf4fb;
  --ink: #1f2d3d;
  --muted: #6b7c93;
  --line: #dbe5f0;
  --line-strong: #bfcddd;
  --accent: #ff7a59;
  --accent-soft: rgba(255, 122, 89, 0.12);
  --accent-strong: #eb6b4d;
  --nav-ink: #eff4ff;
  --nav-muted: #90a3c5;
  --nav-line: rgba(148, 163, 184, 0.18);
  --nav-surface-soft: rgba(255, 255, 255, 0.06);
  --nav-surface-active: linear-gradient(135deg, rgba(255, 107, 53, 0.24), rgba(59, 130, 246, 0.18));
  --success: #198754;
  --warn: #c9850d;
  --danger: #c64550;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.1);
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.06);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", "Inter", "Public Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 107, 53, 0.14), transparent 24%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 20%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-strong) 100%);
}

body.crm-theme-dark {
  --bg: #0b1220;
  --bg-strong: #0f172a;
  --surface: rgba(17, 24, 39, 0.96);
  --surface-soft: #111c30;
  --surface-muted: #152238;
  --ink: #edf3ff;
  --muted: #9eb0cb;
  --line: #263349;
  --line-strong: #33445f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.18);
}

body.crm-theme-dark .report-table th,
body.crm-theme-dark .contact-pool-row--header span {
  background: transparent;
  color: var(--muted);
}

body.crm-theme-dark input,
body.crm-theme-dark select,
body.crm-theme-dark textarea,
body.crm-theme-dark input[disabled],
body.crm-theme-dark textarea[disabled] {
  background: #0f1a2d;
  color: var(--ink);
  border-color: var(--line);
}

body.crm-theme-dark .ghost-button,
body.crm-theme-dark .ghost-link,
body.crm-theme-dark .secondary-button {
  background: linear-gradient(180deg, #2a3546 0%, #222c3b 100%);
  color: var(--ink);
  border-color: var(--line);
}

body.crm-theme-dark .global-topbar,
body.crm-theme-dark .sidebar,
body.crm-theme-dark .sidebar-nav-shell,
body.crm-theme-dark .sidebar-card,
body.crm-theme-dark .brand-block,
body.crm-theme-dark .workspace-panel,
body.crm-theme-dark .modal-card,
body.crm-theme-dark .modal-card__header,
body.crm-theme-dark .global-search-results,
body.crm-theme-dark .user-menu-dropdown,
body.crm-theme-dark .contacts-ops-choice-card,
body.crm-theme-dark .contacts-import-hero__card,
body.crm-theme-dark .contacts-import-map-card,
body.crm-theme-dark .panel-runtime-card,
body.crm-theme-dark .panel-runtime-shell,
body.crm-theme-dark .contact-columns-sidebar,
body.crm-theme-dark .contact-columns-lane,
body.crm-theme-dark .contact-columns-available,
body.crm-theme-dark .company-detail-tab,
body.crm-theme-dark .agent-insight-card,
body.crm-theme-dark .agent-contact-summary--hubspot,
body.crm-theme-dark .agent-record-workspace-header,
body.crm-theme-dark .agent-record-rail__header,
body.crm-theme-dark .agent-workspace-kpi,
body.crm-theme-dark .readonly-field-card,
body.crm-theme-dark .project-ui-block,
body.crm-theme-dark .project-builder-field,
body.crm-theme-dark .user-directory-grid .queue-row,
body.crm-theme-dark .response-list-row,
body.crm-theme-dark .email-log-card,
body.crm-theme-dark .query-builder-card,
body.crm-theme-dark .query-node,
body.crm-theme-dark .field-definition-card {
  background: linear-gradient(180deg, #1d2735 0%, #18212d 100%);
  color: var(--ink);
  border-color: var(--line);
}

body.crm-theme-dark .hero,
body.crm-theme-dark .global-topbar,
body.crm-theme-dark .sidebar {
  background: var(--shell-nav-surface);
}

body.crm-theme-dark .hero .eyebrow,
body.crm-theme-dark .topbar-context .eyebrow,
body.crm-theme-dark .sidebar .eyebrow,
body.crm-theme-dark .nav-submenu-label,
body.crm-theme-dark .brand-copy,
body.crm-theme-dark .queue-row__sub,
body.crm-theme-dark .workspace-copy,
body.crm-theme-dark .readonly-field-card__label,
body.crm-theme-dark .agent-workspace-kpi span {
  color: var(--shell-nav-muted);
}

body.crm-theme-dark .hero h2,
body.crm-theme-dark #topbarTitle,
body.crm-theme-dark .brand-title,
body.crm-theme-dark .nav-chip,
body.crm-theme-dark .nav-subchip,
body.crm-theme-dark .section-heading h3,
body.crm-theme-dark .workspace-section__header h4,
body.crm-theme-dark .detail-section-title,
body.crm-theme-dark .modal-card h4 {
  color: var(--shell-nav-text);
}

body.crm-theme-dark .nav-chip.is-active,
body.crm-theme-dark .nav-subchip.is-active {
  background: rgba(127, 180, 255, 0.12);
  border-color: rgba(127, 180, 255, 0.16);
}

body.crm-theme-dark .primary-button {
  background: linear-gradient(180deg, #76adff 0%, #5d97f7 100%);
  border-color: rgba(127, 180, 255, 0.26);
  color: #0f1824;
}

body.crm-theme-dark .danger-button {
  background: linear-gradient(180deg, #6b3138 0%, #55272d 100%);
  border-color: rgba(226, 120, 132, 0.22);
  color: #fde9ec;
}

body.crm-theme-dark .status-pill,
body.crm-theme-dark .badge,
body.crm-theme-dark .badge--soft {
  border-color: var(--line);
}

body.crm-theme-dark .contact-history-item,
body.crm-theme-dark .contact-history-change {
  background: linear-gradient(180deg, #1d2735 0%, #18212d 100%);
  color: var(--ink);
  border-color: var(--line);
}

body.crm-theme-dark .report-table td,
body.crm-theme-dark .report-table th,
body.crm-theme-dark .table-shell td,
body.crm-theme-dark .table-shell th {
  border-color: var(--line);
}

body.crm-theme-dark .global-search-result:hover,
body.crm-theme-dark .response-list-row:hover,
body.crm-theme-dark .queue-row:hover,
body.crm-theme-dark .list-card:hover {
  background: rgba(255, 255, 255, 0.03);
}

body.crm-theme-light,
body:not(.crm-theme-dark) {
  --nav-ink: #16233a;
  --nav-muted: #60748f;
  --nav-line: rgba(151, 166, 189, 0.22);
  --nav-surface-soft: rgba(18, 32, 51, 0.05);
  --nav-surface-active: linear-gradient(135deg, rgba(255, 107, 53, 0.14), rgba(59, 130, 246, 0.08));
}

body.crm-theme-light .sidebar,
body:not(.crm-theme-dark) .sidebar {
  color: var(--nav-ink);
}

body.crm-theme-light .nav-chip,
body.crm-theme-light .nav-subchip,
body:not(.crm-theme-dark) .nav-chip,
body:not(.crm-theme-dark) .nav-subchip {
  color: var(--nav-ink);
}

body.crm-theme-light .nav-submenu-label,
body:not(.crm-theme-dark) .nav-submenu-label {
  color: var(--nav-muted);
}

body.crm-theme-light .nav-chip.is-active,
body:not(.crm-theme-dark) .nav-chip.is-active {
  color: #16233a;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.16), rgba(59, 130, 246, 0.1));
  border-color: rgba(18, 32, 51, 0.08);
}

body.crm-theme-light .nav-subchip.is-active,
body:not(.crm-theme-dark) .nav-subchip.is-active {
  color: #16233a;
  background: rgba(18, 32, 51, 0.06);
  border-color: rgba(18, 32, 51, 0.08);
}

body.crm-theme-light .sidebar-card,
body:not(.crm-theme-dark) .sidebar-card {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(18, 32, 51, 0.08);
}

body.crm-theme-light .sidebar-card .ghost-button,
body:not(.crm-theme-dark) .sidebar-card .ghost-button {
  color: var(--nav-ink);
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(18, 32, 51, 0.08);
}

body.crm-theme-dark .section-heading h3,
body.crm-theme-dark .workspace-section__header h4,
body.crm-theme-dark .entry-form h4,
body.crm-theme-dark .admin-title,
body.crm-theme-dark .detail-title h4,
body.crm-theme-dark .detail-section-title,
body.crm-theme-dark .workspace-shell h4,
body.crm-theme-dark .workspace-section h4 {
  color: #ffffff;
}

body.crm-theme-dark .section-kicker,
body.crm-theme-dark .workspace-copy,
body.crm-theme-dark .project-config-box__copy,
body.crm-theme-dark .detail-caption,
body.crm-theme-dark .list-card__subtitle,
body.crm-theme-dark .list-card__meta {
  color: #b7c7df;
}

body.crm-theme-dark .agent-override-banner {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.96));
  border-color: var(--line);
}

body.crm-theme-dark .filter-summary-bar,
body.crm-theme-dark .filter-row-card,
body.crm-theme-dark .crm-list-toolbar,
body.crm-theme-dark .crm-table-shell {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.96));
  border-color: var(--line);
}

body.crm-theme-dark .agent-override-banner.is-active {
  background: linear-gradient(180deg, rgba(73, 51, 14, 0.42), rgba(40, 31, 11, 0.52));
  border-color: rgba(201, 133, 13, 0.38);
}

body.crm-theme-dark .badge--warn {
  background: rgba(201, 133, 13, 0.2);
  color: #ffd98a;
}

body.auth-locked {
  overflow: hidden;
}

button,
input,
select,
textarea,
a {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  max-width: 100%;
  overflow-x: hidden;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(14, 27, 45, 0.32);
  backdrop-filter: blur(12px);
}

.auth-overlay.is-hidden {
  display: none;
}

.nav-group.is-hidden {
  display: none;
}

.auth-card {
  width: min(460px, calc(100vw - 32px));
  border-radius: var(--radius-xl);
  padding: 28px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}

.auth-card h2 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.login-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(200, 77, 87, 0.2);
  background: rgba(200, 77, 87, 0.08);
  color: var(--danger);
  font-weight: 600;
}

.login-error.is-hidden {
  display: none;
}

.auth-login-actions {
  display: grid;
  gap: 12px;
}

.auth-login-submit,
.auth-login-secondary {
  width: 100%;
  justify-content: center;
}

.auth-login-footer {
  display: flex;
  justify-content: flex-end;
}

.auth-login-link {
  padding: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--accent);
}

.auth-login-link:hover {
  background: transparent;
  color: var(--accent-strong);
  text-decoration: underline;
}

.user-security-card {
  margin-top: 4px;
}

.user-security-card .field-admin-actions {
  justify-content: flex-start;
}

.sidebar,
.hero {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(219, 230, 243, 0.9);
  box-shadow: var(--shadow);
}

.sidebar {
  background: var(--menu-surface);
  border-radius: var(--radius-xl);
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--nav-ink);
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 200px;
  border-radius: inherit;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
  pointer-events: none;
}

.sidebar-top,
.sidebar-bottom {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
}

.sidebar-top {
  flex: 1 1 auto;
}

.sidebar-bottom {
  flex: 0 0 auto;
}

.eyebrow,
.section-kicker,
.card-label {
  margin: 0 0 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar .eyebrow,
.sidebar .card-label {
  color: var(--nav-muted);
}

.hero h2,
.section-heading h3,
.entry-form h4,
.workspace-section__header h4,
.admin-title {
  margin: 0;
  font-family: "Lexend", "Plus Jakarta Sans", sans-serif;
}

.hero h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.hero {
  padding: 10px 14px;
  min-height: 68px;
  background: linear-gradient(180deg, #243b53 0%, #21384f 100%);
  border-color: rgba(16, 32, 51, 0.22);
  color: #f4f8fc;
  box-shadow: 0 10px 28px rgba(24, 39, 75, 0.18);
}

.hero .eyebrow,
.hero h2,
.hero .ghost-button {
  color: #f4f8fc;
}

.hero .eyebrow {
  margin-bottom: 4px;
  color: #a9bdd2;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#globalSearch {
  min-width: min(520px, 48vw);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

#globalSearch::placeholder {
  color: #c1cfdd;
}

.brand-block {
  display: grid;
  gap: 10px;
  padding: 8px 8px 2px;
}

.brand-mark-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: "Lexend", "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff7f2;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8f69 52%, #ffb493 100%);
  box-shadow: 0 14px 30px rgba(255, 107, 53, 0.28);
}

.brand-meta {
  display: grid;
  gap: 4px;
}

.brand-title {
  margin: 0;
  color: var(--nav-ink);
  font-family: "Lexend", "Plus Jakarta Sans", sans-serif;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.brand-copy {
  display: block;
  margin: 0;
  color: var(--nav-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.brand-copy,
.utility-copy,
.status-panel,
.list-card__subtitle,
.list-card__meta,
.workspace-copy,
.project-field-list,
.report-line span,
.queue-row__sub,
.snapshot-line span,
.detail-caption {
  color: var(--muted);
}

.sidebar-nav,
.filter-row,
.hero-actions,
.stack-list,
.entry-form,
.workspace-panel,
.assignment-fields-grid,
.report-grid,
.report-list,
.snapshot-list,
.field-admin-list,
.filter-builder {
  display: grid;
  gap: 12px;
}

.simple-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text);
}

.simple-list li + li {
  margin-top: 0.28rem;
}

.sidebar-nav-shell {
  border-radius: 20px;
  padding: 10px 9px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--nav-line);
}

.nav-chip {
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--nav-ink);
  text-align: left;
  padding: 10px 12px;
  font-size: 0.92rem;
  font-weight: 700;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, color 140ms ease;
}

.sidebar-nav {
  flex: 0 0 auto;
  gap: 8px;
}

.nav-chip.is-active {
  background: var(--nav-surface-active);
  color: #fff7f2;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.nav-group {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.nav-chip--group {
  font-weight: 700;
  color: #ffffff;
}

.nav-chip:hover,
.nav-subchip:hover {
  transform: translateY(-1px);
}

.nav-chip:not(.is-active):hover {
  background: var(--nav-surface-soft);
  border-color: rgba(255, 255, 255, 0.04);
}

.nav-submenu {
  display: grid;
  gap: 6px;
  padding-left: 12px;
  padding-top: 6px;
  border-left: 1px solid var(--nav-line);
}

.nav-submenu-label {
  padding: 6px 10px 2px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nav-muted);
}

.nav-subchip {
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--nav-muted);
  text-align: left;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav-subchip--child {
  margin-left: 14px;
  padding-left: 14px;
  position: relative;
  font-size: 0.88rem;
}

.nav-subchip--child::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%);
}

.nav-subchip.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.06);
}

.filter-box.filter-box--collapsed {
  display: none;
}

.filter-row--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.sidebar-card,
.workspace-shell,
.workspace-section,
.list-card,
.stat-card,
.assignment-row,
.agent-panel,
.field-admin-row,
.filter-row-card {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}

.sidebar-card {
  padding: 14px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.sidebar-card .card-label,
.sidebar-card .snapshot-line span,
.sidebar-card .status-panel,
.sidebar-card .ghost-button {
  color: var(--nav-muted);
}

.sidebar-card .snapshot-line strong,
.sidebar-card .status-panel.is-good,
.sidebar-card .status-panel.is-error {
  color: var(--nav-ink);
}

.sidebar-card .snapshot-line {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.sidebar-card .ghost-button {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}

.snapshot-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.snapshot-line:last-child {
  border-bottom: none;
}

.status-panel.is-error {
  color: var(--danger);
}

.status-panel.is-good {
  color: var(--success);
}

.main-panel {
  position: relative;
  display: grid;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.app-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(237, 243, 251, 0.72);
  backdrop-filter: blur(12px);
}

.app-loading-overlay.is-hidden {
  display: none;
}

.app-loading-overlay__card {
  min-width: min(420px, 100%);
  max-width: min(420px, calc(100vw - 32px));
  padding: 24px 26px;
  border-radius: 22px;
  border: 1px solid rgba(219, 230, 243, 0.95);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.app-loading-overlay__card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 3px solid rgba(18, 115, 234, 0.15);
  border-top-color: var(--accent);
  animation: pulse-spin 0.8s linear infinite;
}

body.crm-is-busy {
  overflow: hidden;
}

body.crm-is-busy .app-shell {
  pointer-events: none;
  user-select: none;
}

body.crm-is-busy .app-loading-overlay,
body.crm-is-busy .app-loading-overlay * {
  pointer-events: auto;
}

@keyframes pulse-spin {
  to {
    transform: rotate(360deg);
  }
}

.hero {
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(246, 250, 255, 0.96)),
    linear-gradient(180deg, rgba(255, 107, 53, 0.04), rgba(59, 130, 246, 0.03));
  border-color: rgba(214, 224, 238, 0.95);
}

.hero h2 {
  max-width: none;
  font-size: 1.46rem;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.hero-actions {
  width: min(560px, 100%);
  grid-template-columns: 1fr auto auto;
  align-items: center;
}

body.agent-mode .hero {
  display: none;
}

.panel-section {
  display: none;
  gap: 14px;
}

.panel-section.is-visible {
  display: grid;
}

.panel-section--full {
  min-height: calc(100vh - 180px);
  align-content: start;
}

.stats-grid,
.panel-grid,
.agent-layout,
.report-split {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.panel-grid {
  grid-template-columns: 320px 1fr;
}

.panel-grid--wide {
  grid-template-columns: 1fr 1fr;
}

.panel-grid--reporting {
  grid-template-columns: 25% minmax(0, 75%);
  align-items: start;
}

.reporting-project-group {
  display: grid;
  gap: 10px;
}

.reporting-project-group + .reporting-project-group {
  margin-top: 12px;
}

.reporting-project-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reporting-project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.reporting-project-group {
  display: grid;
  gap: 12px;
}

.reporting-project-tile {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 10px;
  text-align: left;
  box-shadow: var(--card-shadow);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.reporting-project-tile:hover,
.reporting-project-tile.is-selected {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--card-shadow);
}

.reporting-project-tile__top,
.reporting-project-tile__meta,
.reporting-project-tile__stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reporting-project-tile__client {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.field-library-card {
  display: grid;
  gap: 1rem;
  overflow: hidden;
}

.field-library-list {
  display: grid;
  gap: 0;
}

.field-library-table {
  display: grid;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
}

.field-library-table__header,
.field-library-row {
  display: grid;
  grid-template-columns: minmax(260px, 2.2fr) minmax(110px, 0.85fr) minmax(110px, 0.9fr) minmax(130px, 1fr) minmax(90px, 0.8fr) 72px minmax(140px, 1fr);
  align-items: center;
  gap: 16px;
}

.field-library-table__header {
  padding: 14px 18px;
  background: #f5f8fb;
  border-bottom: 1px solid #d8e3ef;
}

.field-library-table__header span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #587086;
}

.field-library-table__body {
  display: grid;
}

.field-library-row {
  padding: 16px 18px;
  border-bottom: 1px solid #e3ebf3;
  background: #ffffff;
}

.field-library-row:last-child {
  border-bottom: 0;
}

.field-library-row:hover {
  background: #f9fbfd;
}

.field-library-row__name,
.field-library-row__cell,
.field-library-row__actions {
  min-width: 0;
}

.field-library-row__name-button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.field-library-row__name-button strong {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f3b5f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-library-row__name-button span {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-library-value {
  font-size: 0.84rem;
  color: #2c4b66;
}

.field-library-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.field-library-row__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
}

.panel-grid--agent-tracker {
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
}

.detail-shell--tracker {
  gap: 16px;
}

.agent-tracker-detail-stack {
  display: grid;
  gap: 16px;
}

.entry-form--agent-tracker {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}

.agent-tracker-filters-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.agent-tracker-filters-row--secondary {
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
}

.panel-grid--template-builder {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  align-items: start;
}

.panel-grid--database-settings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.database-settings-form {
  display: grid;
  gap: 16px;
}

.database-settings-panel {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.database-settings-panel.is-hidden {
  display: none;
}

.dialing-embed-shell {
  display: grid;
  gap: 12px;
  min-height: 360px;
}

.dialing-embed-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--hubspot-border);
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9fe 100%);
}

.dialing-embed-card--detail {
  margin-top: 4px;
}

.dialing-embed-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialing-embed-mount {
  min-height: 360px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--hubspot-border));
  background: #ffffff;
  overflow: hidden;
}

.dialing-embed-mount--preview {
  min-height: 420px;
}

.dialing-embed-mount--detail {
  min-height: 320px;
}

.dialing-embed-mount iframe {
  display: block;
  width: 100%;
  min-height: inherit;
  border: 0;
}

.isolated-embed-frame {
  display: block;
  width: 100%;
  min-height: 360px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.isolated-embed-frame--preview {
  min-height: 420px;
}

.isolated-embed-frame--detail {
  min-height: 320px;
}

.isolated-embed-frame--panel {
  min-height: 260px;
  border: 1px solid var(--hubspot-border);
  background: #ffffff;
}

.workspace-empty--embed {
  min-height: 220px;
  place-items: center;
  text-align: center;
}

.panel-grid--database-api {
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
}

#databaseSettingsResetPanel .panel-grid--database-api {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 14px;
}

.project-create-layout--single {
  grid-template-columns: minmax(0, 1fr);
}

.project-create-form,
.project-config-grid {
  display: grid;
  gap: 14px;
}

.project-config-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.project-config-grid--stacked {
  grid-template-columns: minmax(0, 1fr);
}

#adminWorkspace .workspace-panel {
  gap: 16px;
}

#adminWorkspace > .assignment-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--surface) 34%);
}

.project-config-box {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.92));
}

.project-config-box--full {
  width: 100%;
}

.project-config-box--controls {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, white), rgba(245, 248, 255, 0.94));
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
}

.project-config-box__copy {
  margin: -6px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.panel-card--feature {
  min-height: 100%;
}

.stat-card,
.list-card,
.assignment-row,
.workspace-shell,
.workspace-section,
.agent-panel {
  padding: 14px;
}

.stat-card p,
.stat-card h3,
.list-card p,
.list-card h4,
.assignment-row p,
.assignment-row h4,
.workspace-shell p,
.workspace-shell h4,
.workspace-section h4,
.agent-panel h4 {
  margin: 0;
}

.stat-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.96) 100%);
  min-height: 112px;
  border: 1px solid rgba(216, 226, 239, 0.95);
  box-shadow: var(--shadow-soft);
}

.stat-card--target {
  background: linear-gradient(180deg, rgba(245, 248, 255, 0.98) 0%, rgba(234, 241, 255, 0.96) 100%);
}

.stat-card--positive,
.stat-card--success {
  background: linear-gradient(180deg, rgba(240, 252, 247, 0.98) 0%, rgba(224, 246, 235, 0.96) 100%);
  border-color: rgba(127, 188, 152, 0.42);
}

.stat-card--remaining {
  background: linear-gradient(180deg, rgba(255, 250, 238, 0.98) 0%, rgba(255, 243, 214, 0.96) 100%);
  border-color: rgba(214, 184, 118, 0.45);
}

.stat-card--warn {
  background: linear-gradient(180deg, rgba(255, 244, 241, 0.98) 0%, rgba(255, 231, 224, 0.96) 100%);
  border-color: rgba(219, 142, 118, 0.45);
}

.stat-card--value,
.stat-card--rate,
.stat-card--neutral {
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.98) 0%, rgba(239, 244, 250, 0.96) 100%);
}

.stat-card h3 {
  margin-top: 10px;
  font-size: 1.72rem;
  letter-spacing: -0.04em;
  font-family: "Lexend", "Plus Jakarta Sans", sans-serif;
}

.stat-card__accent {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 6px;
}

.stat-card__accent--danger {
  color: #c84d57;
}

.section-heading,
.list-card__top,
.assign-toolbar,
.workspace-header,
.workspace-section__header,
.report-split,
.agent-toolbar,
.detail-header,
.detail-navigation,
.assignment-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.assign-toolbar,
.assignment-actions,
.detail-navigation {
  align-items: center;
}

.assignment-actions--filter-stack {
  display: grid;
  gap: 10px;
  width: 100%;
}

.assignment-actions--filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  width: 100%;
}

.assignment-actions__full,
.assignment-actions__half,
.assignment-actions__quarter {
  width: 100%;
}

.section-heading {
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(216, 226, 239, 0.72);
}

.inline-filter {
  display: grid;
  gap: 8px;
  color: var(--muted);
  min-width: 190px;
}

.company-filters-row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) repeat(3, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 10px;
  margin-bottom: 10px;
}

.company-filters-row .inline-filter {
  min-width: 0;
}

.company-directory-shell {
  display: grid;
  gap: 14px;
  overflow: hidden;
}

.company-directory-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.company-directory-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.company-directory-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid #d8e3ef;
  background: #f8fbfe;
  color: #143a5b;
  font-weight: 800;
}

.company-directory-tab.is-active {
  background: #ffffff;
  box-shadow: inset 0 -2px 0 #3f82c3;
}

.company-directory-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7eff8;
  color: #315678;
  font-size: 0.78rem;
  font-weight: 800;
}

.company-directory-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.company-directory-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.company-directory-search {
  display: flex;
}

.company-directory-search input {
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #d8e3ef;
  background: #ffffff;
}

.company-directory-toolbar__controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.company-directory-list {
  display: grid;
  gap: 12px;
}

.company-directory-table {
  display: grid;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
}

.company-directory-table__header,
.company-directory-row {
  display: grid;
  grid-template-columns: var(--company-directory-template, minmax(260px, 2fr) minmax(220px, 1.4fr) 110px 130px 140px 160px);
  gap: 18px;
  align-items: center;
}

.company-directory-table__header {
  padding: 14px 18px;
  background: #f5f8fb;
  border-bottom: 1px solid #d8e3ef;
}

.company-directory-table__header span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #587086;
}

.company-directory-table__body {
  display: grid;
}

.company-directory-row {
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid #e3ebf3;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
}

.company-directory-row:last-child {
  border-bottom: 0;
}

.company-directory-row:hover {
  background: #f9fbfd;
}

.company-directory-row.is-selected {
  background: #eef5fc;
}

.company-directory-row__name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.company-directory-row__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e8f1fb 0%, #dceafb 100%);
  color: #336084;
  font-size: 0.78rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.company-directory-row__identity {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.company-directory-row__identity strong {
  font-size: 1rem;
  font-weight: 800;
  color: #0f3b5f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-directory-row__identity small {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-directory-row__cell {
  min-width: 0;
  color: #35526d;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-directory-row__cell--link {
  color: #1081b6;
}

@media (max-width: 1280px) {
  .company-directory-table__header,
  .company-directory-row {
    gap: 14px;
  }
}

@media (max-width: 1080px) {
  .company-directory-toolbar {
    grid-template-columns: 1fr;
  }

  .company-directory-toolbar__controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .company-directory-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .company-directory-actions {
    justify-content: flex-start;
  }

  .company-directory-toolbar__controls {
    grid-template-columns: 1fr;
  }

  .company-directory-table__header {
    display: none;
  }

  .company-directory-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

#companyCreateModal .modal-card {
  width: min(760px, calc(100vw - 32px));
}

#companyCreateModal .report-builder-modal-shell {
  gap: 1rem;
}

#companyCreateModal .report-builder-modal-body {
  display: grid;
  gap: 1rem;
  padding-top: 0.25rem;
}

#companyCreateModal .response-modal-panel__grid {
  gap: 14px;
}

#companyCreateModal .assignment-actions {
  padding-top: 0.35rem;
  border-top: 1px solid var(--hubspot-line);
}

.agent-project-picker {
  display: none;
}

.entry-form label,
.assignment-field,
.assignment-row > label,
.contact-detail-grid label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 11px 13px;
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
  background: #ffffff;
}

textarea[disabled],
input[disabled] {
  color: var(--ink);
  background: var(--surface-soft);
}

.multi-select {
  min-height: 132px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.multi-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.multi-select-picker {
  position: relative;
  display: grid;
  gap: 8px;
}

.inline-help-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-help-button {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

.inline-help-button:hover,
.inline-help-button:focus-visible {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
  outline: none;
}

.exclusion-mode-help-list {
  display: grid;
  gap: 12px;
}

.exclusion-mode-help-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 16px 18px;
  display: grid;
  gap: 8px;
}

.exclusion-mode-help-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.exclusion-mode-help-card__header h5 {
  margin: 0;
  font-size: 1rem;
}

.exclusion-mode-help-card p {
  margin: 0;
  color: var(--ink-soft);
}

.workspace-copy-stack {
  display: grid;
  gap: 10px;
}

.workspace-copy-stack p {
  margin: 0;
}

.multi-select-picker__trigger {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 10px 12px;
  color: var(--ink);
}

.multi-select-picker__trigger:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

.multi-select-picker__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.multi-select-picker__placeholder {
  color: var(--muted);
  padding-top: 3px;
}

.multi-select-picker__caret {
  color: var(--muted);
  font-size: 0.88rem;
  padding-top: 4px;
}

.multi-select-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.multi-select-chip__remove {
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.multi-select-picker__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 18;
  display: none;
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: var(--shadow);
}

.multi-select-picker__search {
  display: block;
}

.multi-select-picker__search-input {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.multi-select-picker__search-input:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

.multi-select-picker.is-open .multi-select-picker__dropdown {
  display: grid;
}

.multi-select-picker__actions {
  display: flex;
  gap: 8px;
}

.multi-select-picker__actions .secondary-button {
  padding: 8px 10px;
  font-size: 0.82rem;
}

.multi-select-picker__options {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.multi-select-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 9px 10px;
}

.multi-select-option:hover,
.multi-select-option.is-selected {
  background: color-mix(in srgb, var(--accent) 10%, white);
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
}

.multi-select-option__check {
  width: 18px;
  color: var(--accent-strong);
  font-weight: 800;
}

body.crm-theme-dark .multi-select-picker__trigger,
body.crm-theme-dark .multi-select-picker__dropdown,
body.crm-theme-dark .multi-select-picker__search-input {
  background: #0f1a2d;
  border-color: var(--line);
}

.multi-select-picker[data-variant="quiet"] .multi-select-chip {
  background: #eaf1f7;
  color: #294764;
}

.multi-select-picker[data-variant="quiet"] .multi-select-picker__trigger {
  background: #f7fafc;
}

body.crm-theme-dark .multi-select-option {
  color: var(--ink);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.editor-textarea {
  min-height: 180px;
  font-family: "Consolas", "SFMono-Regular", monospace;
}

.editor-textarea--compact {
  min-height: 120px;
}

.template-builder {
  display: grid;
  gap: 12px;
}

.workspace-header--template {
  align-items: flex-start;
}

.template-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(220px, 0.9fr);
  gap: 12px;
  align-items: end;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #f9fbfe 0%, #eef4fb 100%);
}

.template-toolbar .secondary-button,
.template-preview-card__header .ghost-button {
  padding: 9px 12px;
}

.template-builder__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.template-editor-field {
  display: grid;
  gap: 8px;
}

.template-editor-shell {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #fcfdff 0%, #f4f8fc 100%);
}

.template-editor-shell__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.template-editor-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.template-editor-tabs .secondary-button {
  min-width: 76px;
}

.template-editor-tabs .secondary-button.is-active {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 10px 22px rgba(255, 107, 53, 0.18);
}

.template-editor-shell__body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.2fr) minmax(320px, 0.9fr);
  gap: 14px;
  min-height: 520px;
}

.template-editor-field--source,
.template-editor-builder-panel,
.template-editor-preview-panel {
  min-width: 0;
}

.template-grapes-host {
  min-height: 560px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #ffffff;
}

.template-grapes-host .gjs-one-bg,
.template-grapes-host .gjs-two-color {
  color: #d9e6f5;
}

.template-grapes-host .gjs-one-bg {
  background: #102034;
}

.template-grapes-host .gjs-two-bg {
  background: #16283d;
}

.template-grapes-host .gjs-three-bg {
  background: #edf3f9;
  color: #203246;
}

.template-grapes-host .gjs-four-color,
.template-grapes-host .gjs-pn-btn.gjs-pn-active,
.template-grapes-host .gjs-block-label {
  color: var(--accent);
}

.template-source-editor {
  min-height: 100%;
  height: 100%;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, #c9d8ea);
  background: #0f1728;
  color: #d9e6f5;
  line-height: 1.65;
  font-size: 0.93rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.template-source-editor::placeholder {
  color: rgba(217, 230, 245, 0.46);
}

.template-preview--interactive {
  min-height: 430px;
}

.template-editor-shell[data-template-editor-mode="source"] .template-editor-builder-panel,
.template-editor-shell[data-template-editor-mode="source"] .template-editor-preview-panel {
  display: none;
}

.template-editor-shell[data-template-editor-mode="builder"] .template-editor-field--source,
.template-editor-shell[data-template-editor-mode="builder"] .template-editor-preview-panel {
  display: none;
}

.template-editor-shell[data-template-editor-mode="preview"] .template-editor-field--source,
.template-editor-shell[data-template-editor-mode="preview"] .template-editor-builder-panel {
  display: none;
}

.template-editor-shell[data-template-editor-mode="source"] .template-editor-shell__body,
.template-editor-shell[data-template-editor-mode="builder"] .template-editor-shell__body,
.template-editor-shell[data-template-editor-mode="preview"] .template-editor-shell__body {
  grid-template-columns: minmax(0, 1fr);
}

.template-preview-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.template-preview-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.template-preview-card__header .section-kicker {
  margin-bottom: 0;
}

.template-preview-card--full {
  min-height: 100%;
}

.template-preview {
  min-height: 260px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
  overflow: auto;
}

.template-preview > *:first-child {
  margin-top: 0;
}

.template-preview > *:last-child {
  margin-bottom: 0;
}

.template-preview iframe {
  max-width: 100%;
}

.inline-copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.inline-copy-field input[readonly] {
  background: var(--surface-soft);
}

.ghost-button,
.ghost-link,
.primary-button,
.secondary-button,
.danger-button,
.entry-form button,
.assign-toolbar button {
  border: none;
  border-radius: 12px;
  padding: 10px 13px;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.primary-button,
.entry-form button,
.assign-toolbar button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  box-shadow: 0 10px 22px rgba(255, 107, 53, 0.22);
}

.ghost-button,
.ghost-link,
.secondary-button {
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  color: var(--ink);
  border: 1px solid var(--line);
}

.danger-button {
  background: rgba(200, 77, 87, 0.1);
  color: var(--danger);
}

.ghost-button:hover,
.ghost-link:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.entry-form button:hover,
.assign-toolbar button:hover,
.pagination-page:hover {
  transform: translateY(-1px);
}

.inline-create {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.badge {
  align-self: start;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: color-mix(in srgb, var(--accent) 14%, white);
  color: var(--accent-strong);
}

.badge--warn {
  background: color-mix(in srgb, #c9850d 18%, white);
  color: #8a5c00;
}

.filter-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
}

.filter-summary-bar__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-summary-bar__label {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.filter-control {
  display: grid;
  gap: 6px;
}

.filter-control > span {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.agent-override-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
}

.agent-override-banner.is-active {
  border-color: color-mix(in srgb, #c9850d 26%, var(--line));
  background: linear-gradient(180deg, rgba(255, 248, 232, 0.98), rgba(255, 252, 244, 0.96));
}

.agent-override-toggle {
  white-space: nowrap;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  background: var(--surface-muted);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contact-pool-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.crm-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
}

.crm-list-toolbar__title,
.crm-list-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-table-shell {
  padding: 4px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.render-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  color: var(--muted);
}

.render-summary strong {
  color: var(--ink);
}

.render-summary__hint {
  font-size: 0.9rem;
}

.contact-pool-table {
  display: grid;
  gap: 4px;
  width: max-content;
  min-width: 100%;
}

.contact-pool-row {
  display: grid;
  grid-template-columns: var(--contact-grid-template, repeat(6, minmax(170px, 1fr)) minmax(190px, max-content));
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(216, 226, 239, 0.92);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.contact-pool-row--status {
  border-color: color-mix(in srgb, var(--contact-status-color) 26%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--contact-status-color) 12%, white) 0%, color-mix(in srgb, var(--contact-status-color) 7%, #f9fbfe) 100%);
}

.contact-pool-row--header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-top: 0;
  padding-bottom: 4px;
  border: none;
  background: rgba(246, 249, 252, 0.96);
  box-shadow: none;
  border-radius: 0;
}

.contact-pool-row--header span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-pool-header-cell {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  padding-right: 8px;
}

.contact-pool-header-cell__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-pool-header-cell--actions {
  justify-content: flex-end;
}

.contact-column-resizer {
  position: absolute;
  top: -6px;
  right: -8px;
  width: 16px;
  height: calc(100% + 12px);
  padding: 0;
  border: none;
  background: transparent;
  cursor: col-resize;
  opacity: 0.65;
}

.contact-column-resizer::after {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 50%;
  width: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 72%, white), color-mix(in srgb, var(--accent) 42%, var(--line)));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.82);
}

.contact-pool-header-cell:hover .contact-column-resizer,
.contact-column-resizer:focus-visible {
  opacity: 1;
}

.contact-pool-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  line-height: 1.15;
}

.contact-pool-cell--primary {
  font-weight: 700;
  color: var(--ink);
}

.contact-pool-identity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.contact-pool-avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent-strong);
  font-size: 0.66rem;
  font-weight: 800;
}

.contact-pool-identity__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-pool-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.bulk-selection-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(180px, max-content);
  gap: 12px;
  align-items: end;
}

.bulk-selection-grid__inline {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.bulk-selection-grid .checkbox-line--inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  min-height: 44px;
  white-space: nowrap;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.bulk-field-picker .filter-combobox__menu,
.bulk-project-picker .filter-combobox__menu {
  gap: 4px;
}

.bulk-field-picker .filter-combobox__option,
.bulk-project-picker .filter-combobox__option {
  padding: 10px 12px;
}

.bulk-field-picker .filter-combobox__option strong,
.bulk-project-picker .filter-combobox__option strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  color: inherit;
}

#bulkActionModal .workspace-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

#bulkActionModal .workspace-section {
  margin: 0;
}

#bulkActionModal .workspace-shell {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

#bulkActionModal label > .filter-combobox,
#bulkActionModal label > input,
#bulkActionModal label > select {
  margin-top: 6px;
}

#noticeModal .modal-card {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.22);
}

#noticeModal .workspace-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}

#noticeModal .workspace-panel {
  display: grid;
  gap: 16px;
  padding: 20px 22px 22px;
}

#noticeModal #noticeMessage {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink);
}

#noticeModal .assignment-actions {
  justify-content: flex-end;
}

#noticeModal #noticeConfirmButton {
  background: linear-gradient(180deg, #0d6efd 0%, #0a5ad4 100%);
  border-color: #0a5ad4;
}

#noticeModal #noticeCancelButton {
  background: linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%);
}

.contact-pool-actions select {
  min-width: 120px;
  max-width: 148px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.contact-columns-panel {
  display: grid;
  gap: 18px;
}

.contact-columns-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-columns-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  color: var(--muted);
  font-weight: 700;
}

.contact-columns-tab.is-active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  color: var(--accent);
}

.contact-columns-group {
  display: grid;
  gap: 12px;
}

.contact-columns-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.contact-columns-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  font-size: 0.94rem;
}

.contact-columns-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  background: #fff;
  display: inline-block;
  flex: 0 0 auto;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.contact-columns-option input[type="checkbox"]::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform 140ms ease;
}

.contact-columns-option input[type="checkbox"]:checked {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  box-shadow: 0 4px 10px color-mix(in srgb, var(--accent) 22%, transparent);
}

.contact-columns-option input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(1);
}

.contact-columns-option input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.contact-pool-footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.pagination-bar,
.pagination-pages {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-grid--overview-top {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  align-items: start;
}

.panel-grid--overview-main {
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  align-items: start;
}

.overview-stat-card {
  gap: 6px;
  min-height: 132px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 10%, white) 0%, transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.overview-stat-card p {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.overview-stat-card h3 {
  font-size: 1.9rem;
  letter-spacing: -0.05em;
}

.overview-stat-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.overview-brief-card,
.overview-insight-card,
.overview-project-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 8%, white) 0%, transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: var(--shadow-soft);
}

.overview-brief-card,
.overview-insight-card {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.overview-brief-card__top,
.overview-insight-card__top,
.overview-project-card__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.overview-brief-card__top h4,
.overview-insight-card__top h4,
.overview-project-card h4 {
  margin: 0;
  letter-spacing: -0.04em;
  font-size: 1.15rem;
}

.overview-brief-grid,
.overview-bullet-list {
  display: grid;
  gap: 10px;
}

.overview-bullet {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.overview-bullet strong {
  font-size: 0.96rem;
}

.overview-bullet span {
  color: var(--muted);
  white-space: nowrap;
}

.overview-bullet--stacked {
  align-items: start;
}

.overview-bullet--stacked > div {
  display: grid;
  gap: 4px;
}

.overview-bullet--stacked span {
  white-space: normal;
}

.overview-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-project-card {
  width: 100%;
  padding: 18px;
  display: grid;
  gap: 14px;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.overview-project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.1);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.overview-project-card__progress {
  display: grid;
  gap: 8px;
}

.overview-project-card__progress strong {
  font-size: 0.9rem;
}

.overview-project-card__progress-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-strong);
}

.overview-project-card__progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #63b2ff);
}

.overview-project-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-project-card__stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  color: var(--muted);
}

.overview-project-card__stats strong {
  color: var(--text);
}

.pagination-bar {
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.pagination-pages {
  flex-wrap: wrap;
}

.pagination-page {
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  color: var(--ink);
  font-weight: 700;
}

.pagination-page.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.pagination-ellipsis {
  padding: 0 4px;
  color: var(--muted);
  font-weight: 700;
}

.utility-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.utility-block--flush {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.filter-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fbfdff 0%, #f3f8fd 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.workspace-panel {
  gap: 18px;
}

.workspace-section {
  display: grid;
  gap: 10px;
}

.workspace-shell--compact {
  padding: 14px 16px;
}

.workspace-header--topline {
  align-items: flex-start;
}

.workspace-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.workspace-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  color: var(--muted);
  font-weight: 700;
}

.workspace-tab.is-active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  color: var(--accent);
}

.assignment-row--dense {
  gap: 12px;
}

.stack-list--dense {
  gap: 8px;
}

.project-product-empty-state strong {
  color: var(--ink);
}

.project-create-product-card {
  padding: 16px;
}

.project-product-editor {
  gap: 0;
  overflow: hidden;
}

.project-product-editor__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  color: inherit;
}

.project-product-editor__toggle:hover {
  transform: none;
}

.project-product-editor__body {
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.project-product-editor__body.is-hidden {
  display: none;
}

.list-card--dense {
  padding: 12px;
}

.workspace-empty {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--line-strong);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.feature-list {
  display: grid;
  gap: 12px;
}

.feature-line,
.report-item {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 16px;
}

.feature-line strong,
.report-item strong {
  display: block;
  margin-bottom: 6px;
}

.feature-line span,
.report-item p,
.report-item__meta {
  color: var(--muted);
}

.feature-line--step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.feature-line__step-index {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  background: #eef5fb;
  color: var(--hubspot-navy);
  font-weight: 800;
}

.feature-line__copy {
  min-width: 0;
}

.company-matching-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: end;
}

.company-matching-toolbar__field {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.company-matching-toolbar__field span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.company-match-row {
  display: grid;
  gap: 14px;
}

.company-match-row__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.company-match-row__select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--hubspot-navy);
}

.company-match-row__select input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.company-match-row__score {
  text-align: right;
}

.company-match-row__score strong {
  display: block;
  font-size: 1.05rem;
}

.company-match-row__score span {
  color: var(--muted);
  font-size: 0.85rem;
}

.company-match-row__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.company-match-row__company {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f9fcff;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.company-match-row__company--target {
  border-color: rgba(30, 102, 214, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
}

.company-match-row__company--source {
  border-color: rgba(255, 120, 90, 0.2);
  background: linear-gradient(180deg, #ffffff 0%, #fff8f5 100%);
}

.company-match-row__company h4 {
  margin: 0;
  font-size: 1.05rem;
}

.company-match-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.company-match-row__reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.company-match-row__warning {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(240, 146, 53, 0.24);
  background: linear-gradient(180deg, #fffaf2 0%, #fff6ea 100%);
  color: #8a4b12;
  font-size: 0.92rem;
}

.company-match-row__compare {
  display: none;
}

.company-match-row__compare.is-open {
  display: block;
}

.company-match-row__compare-table {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}

.company-match-row__compare-head,
.company-match-row__compare-label,
.company-match-row__compare-value {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.company-match-row__compare-head {
  background: #f4f8fc;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hubspot-navy);
}

.company-match-row__compare-label {
  font-weight: 700;
  color: var(--hubspot-navy);
  background: #fbfdff;
}

.company-match-row__compare-value {
  color: var(--text);
}

.company-match-row__compare-label.is-different,
.company-match-row__compare-value.is-different {
  background: #fff8f4;
}

.company-match-row__compare-table > :nth-last-child(-n + 3) {
  border-bottom: none;
}

.company-match-row__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.report-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-grid--dense {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.email-log-summary-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.email-log-summary-row .stat-card {
  min-width: 0;
}

.email-log-summary-row .stat-card p,
.email-log-summary-row .stat-card h3 {
  white-space: nowrap;
}

.email-log-hubspot-shell {
  border: 1px solid #d7e3f0;
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
}

.email-log-hubspot-table__header,
.email-log-hubspot-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.55fr) minmax(200px, 1.25fr) minmax(120px, 0.95fr) 120px 120px 160px minmax(180px, 1fr) 160px;
  gap: 14px;
  align-items: start;
  padding: 0 18px;
}

.email-log-hubspot-table__header {
  min-height: 52px;
  align-items: center;
  background: #f5f9fd;
  border-bottom: 1px solid #dbe6f1;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #496681;
}

.email-log-hubspot-row {
  min-height: 86px;
  padding-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e8eef5;
}

.email-log-hubspot-row:last-child {
  border-bottom: 0;
}

.email-log-hubspot-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.email-log-hubspot-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-log-hubspot-row__actions {
  display: flex !important;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.email-log-hubspot-row.is-email-error {
  background: rgba(200, 77, 87, 0.04);
}

.email-log-hubspot-row.is-email-warning {
  background: rgba(201, 133, 13, 0.04);
}

.email-log-hubspot-row.is-email-success {
  background: rgba(25, 135, 84, 0.03);
}

.report-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.report-line:last-child {
  border-bottom: none;
}

.report-item {
  display: grid;
  gap: 14px;
}

.report-item__top,
.report-progress,
.report-item__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.report-item__top p {
  margin: 6px 0 0;
}

.report-progress__bar {
  height: 10px;
  flex: 1;
  border-radius: 999px;
  background: var(--bg-strong);
  overflow: hidden;
}

.report-progress__bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #4aa2ff);
}

.report-progress__bar--early span {
  background: linear-gradient(90deg, #93a9c4, #b8c7da);
}

.report-progress__bar--active span {
  background: linear-gradient(90deg, #f4b43c, #ffd36c);
}

.report-progress__bar--healthy span {
  background: linear-gradient(90deg, #46a6ff, #7bc3ff);
}

.report-progress__bar--complete span {
  background: linear-gradient(90deg, #1dbe72, #74d79d);
}

.report-item__meta {
  flex-wrap: wrap;
}

.report-table-wrap {
  overflow-x: auto;
}

.modal-shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 20;
}

#noticeModal {
  z-index: 60;
}

.modal-shell--stacked-left,
.modal-shell--stacked-right {
  place-items: stretch;
  padding: 24px;
}

.modal-shell--stacked-left .modal-card,
.modal-shell--stacked-right .modal-card {
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.modal-shell--stacked-left .modal-card {
  margin-right: auto;
  width: min(720px, calc(100vw - 420px));
}

.modal-shell--stacked-right {
  z-index: 30;
  pointer-events: none;
}

.modal-shell--stacked-right .modal-backdrop {
  display: none;
}

.modal-shell--stacked-right .modal-card {
  margin-left: auto;
  width: min(760px, calc(100vw - 420px));
  pointer-events: auto;
}

.modal-shell.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 27, 45, 0.38);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 32px));
  border-radius: var(--radius-xl);
  padding: 22px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-card--wide {
  width: min(1040px, calc(100vw - 32px));
}

.agent-layout {
  grid-template-columns: 360px 1fr;
}

.agent-layout--detail {
  grid-template-columns: 1fr;
}

.agent-layout--list-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100vh - 136px);
  overflow: hidden;
  min-height: 0;
}

.agent-launcher {
  display: grid;
  gap: 18px;
}

.agent-launcher__hero,
.agent-workspace-overview {
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 10%, white) 0%, transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  padding: 22px 24px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.agent-launcher__hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 18px;
  align-items: stretch;
}

.agent-launcher__hero-copy,
.agent-launcher__library,
.agent-workspace-overview__hero {
  display: grid;
  gap: 10px;
}

.agent-launcher__hero-copy h3,
.agent-workspace-overview__hero h3 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2rem);
  letter-spacing: -0.05em;
}

.agent-launcher__hero-stats,
.agent-workspace-overview__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.agent-launcher-stat {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--line));
  background: rgba(255, 255, 255, 0.84);
}

.agent-launcher-stat span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.agent-launcher-stat strong {
  font-size: 1.4rem;
  letter-spacing: -0.04em;
}

.agent-launcher__library {
  display: grid;
  gap: 14px;
}

.agent-panel {
  display: grid;
  gap: 16px;
}

.panel-card--agent-detail {
  width: 100%;
}

.queue-list {
  display: grid;
  gap: 10px;
}

.queue-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 13px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.queue-row.is-selected {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, white), rgba(248, 251, 255, 1));
}

.queue-row strong,
.queue-row span {
  display: block;
}

.queue-row__meta {
  display: grid;
  gap: 2px;
}

.detail-shell {
  display: grid;
  gap: 12px;
  height: 100%;
}

.modal-card--fullscreen {
  width: min(1600px, 96vw);
  max-width: 96vw;
  max-height: 94vh;
}

.company-detail-shell {
  display: grid;
  gap: 1rem;
}

.company-detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: var(--shadow-soft);
}

.company-detail-hero h3 {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.85rem;
  letter-spacing: -0.04em;
}

.company-detail-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.company-detail-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.4fr);
  gap: 1rem;
  align-items: start;
}

.company-detail-grid--matching {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.company-detail-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.company-detail-grid__span-2 {
  grid-column: 1 / -1;
}

.company-merge-combobox .filter-combobox__menu {
  max-height: 220px;
}

.company-alias-form-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.45fr) minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.company-alias-form-row .secondary-button {
  white-space: nowrap;
}

.company-merge-preview {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 92%, var(--accent) 8%);
  display: grid;
  gap: 0.75rem;
}

.company-alias-list {
  display: grid;
  gap: 10px;
}

.company-alias-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.4fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
}

.company-alias-card__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.company-merge-actions {
  margin-top: 10px;
}

.company-location-create {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 96%, var(--accent) 4%);
}

.company-location-list {
  display: grid;
  gap: 10px;
}

.company-location-card {
  display: grid;
  gap: 10px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
  overflow: hidden;
}

.company-location-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.company-location-card__title {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.company-location-card__title input {
  font-weight: 700;
}

.company-location-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.company-location-card__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.company-location-card__header-button {
  width: 100%;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.company-location-card__header-button:hover {
  background: color-mix(in srgb, var(--accent) 4%, white);
}

.company-location-card__summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.company-location-card__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
}

.company-location-card__body {
  display: none;
  gap: 12px;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.company-location-card.is-expanded .company-location-card__body {
  display: grid;
}

.company-location-create .contact-detail-grid--dense,
.company-location-card .contact-detail-grid--dense {
  row-gap: 10px;
}

.company-location-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.company-location-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  min-height: 22px;
  font-weight: 600;
  white-space: nowrap;
}

.company-location-flag input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
}

.company-location-flag span {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.company-linked-contact-row {
  cursor: pointer;
}

.company-linked-contact-row:hover {
  background: color-mix(in srgb, var(--accent) 5%, white);
}

@media (max-width: 1080px) {
  .company-detail-grid,
  .company-detail-grid--matching {
    grid-template-columns: minmax(0, 1fr);
  }

  .company-alias-form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .company-alias-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .company-location-card__header {
    flex-direction: column;
  }

  .company-location-card__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .company-detail-hero {
    flex-direction: column;
  }

  .company-detail-hero__stats {
    justify-content: flex-start;
  }
}

.detail-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-soft);
}

.detail-title {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.detail-title h4 {
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  font-family: "Lexend", "Plus Jakarta Sans", sans-serif;
}

.detail-navigation {
  justify-content: flex-start;
}

.agent-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: var(--shadow-soft);
}

.agent-topbar__group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.agent-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.agent-project-card {
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--line));
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(13, 110, 253, 0.06) 0%, transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  padding: 18px;
  display: grid;
  gap: 14px;
  text-align: left;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.05);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.agent-project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.09);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}

.agent-project-card__top,
.agent-project-card__stats,
.agent-project-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.agent-project-card__stats,
.agent-project-card__meta {
  flex-wrap: wrap;
}

.agent-project-card h4 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  font-family: "Lexend", "Plus Jakarta Sans", sans-serif;
}

.agent-project-card__subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.agent-project-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.agent-project-card__progress {
  display: grid;
  gap: 7px;
}

.agent-project-card__progress strong {
  font-size: 0.9rem;
}

.agent-project-card__progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-strong);
  overflow: hidden;
}

.agent-project-card__progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #65b3ff);
}

.agent-project-card__stats span,
.agent-project-card__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid color-mix(in srgb, var(--accent) 8%, var(--line));
  color: var(--muted);
}

.agent-project-card__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.agent-project-card__stats span {
  display: grid;
  gap: 4px;
  padding: 12px 13px;
  border-radius: 16px;
  align-items: start;
}

.agent-project-card__stats strong {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.1;
}

.agent-project-card__stats small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.agent-project-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--accent) 10%, var(--line));
  color: var(--accent);
  font-weight: 700;
}

.agent-project-card__cta::after {
  content: "→";
  font-size: 1rem;
}

.agent-workspace-overview {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
}

.agent-workspace-overview__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.agent-workspace-overview__meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.agent-workspace-overview__stats {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
}

.agent-workspace-overview__stats .agent-launcher-stat {
  min-width: 132px;
  padding: 12px 14px;
}

.company-summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.company-summary-stat {
  display: inline-grid;
  gap: 2px;
  min-width: 92px;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--line));
  text-align: right;
}

.company-summary-stat strong {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.1;
}

.company-summary-stat small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.agent-launcher-stat--interactive {
  cursor: pointer;
  text-align: left;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.agent-launcher-stat--interactive:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(16, 50, 92, 0.12);
}

.agent-workspace-overview__stats .agent-launcher-stat strong {
  font-size: 1.1rem;
}

.agent-list-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  height: calc(100vh - var(--shell-topbar-height) - 166px);
  overflow: hidden;
}

.agent-list-shell.is-filter-open {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 25%);
}

.agent-list-shell__main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.agent-product-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 4px 2px;
  margin: -4px -2px;
  max-width: min(52vw, 760px);
}

.agent-workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.agent-workspace-toolbar__project-code {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid #d8e3ef;
  background: #ffffff;
  color: #163a59;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.agent-workspace-toolbar .agent-product-strip {
  flex: 1 1 auto;
  justify-content: flex-end;
}

.agent-workspace-toolbar .secondary-button,
.agent-workspace-toolbar .badge {
  flex: 0 0 auto;
}

.agent-product-chip {
  display: grid;
  gap: 4px;
  min-width: 132px;
  padding: 10px 12px 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--agent-chip-border, rgba(27, 74, 122, 0.12));
  background: var(--agent-chip-bg, linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 249, 255, 0.98) 100%));
  box-shadow: 0 2px 10px rgba(16, 50, 92, 0.05);
  text-align: left;
  overflow: hidden;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease, opacity 120ms ease;
  position: relative;
  opacity: 0.82;
}

.agent-product-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(16, 50, 92, 0.1);
  border-color: var(--agent-chip-active-border, rgba(25, 109, 255, 0.35));
  opacity: 1;
}

.agent-product-chip.is-active {
  border-color: var(--agent-chip-active-border, rgba(25, 109, 255, 0.35));
  background: var(--agent-chip-active-bg, linear-gradient(180deg, rgba(231, 241, 255, 0.98) 0%, rgba(218, 235, 255, 0.98) 100%));
  box-shadow: 0 14px 28px rgba(16, 50, 92, 0.16);
  opacity: 1;
}

.agent-product-chip__title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--agent-chip-accent, var(--text));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-product-chip__meta {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

.agent-product-chip.is-active .agent-product-chip__title {
  color: color-mix(in srgb, var(--agent-chip-accent, var(--text)) 82%, #0b2f4d);
}

.agent-product-chip.is-active .agent-product-chip__meta {
  color: #315678;
  font-weight: 700;
}

.agent-product-chip::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--agent-chip-accent, #315678);
}

.agent-product-chip.is-active::before {
  width: 6px;
}

.agent-product-chip.is-active::after {
  content: "Selected";
  position: absolute;
  top: 8px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid color-mix(in srgb, var(--agent-chip-accent, #315678) 24%, white);
  color: var(--agent-chip-accent, #315678);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.exclusion-monitor-shell {
  gap: 14px;
}

.exclusion-monitor-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.exclusion-monitor-toolbar__filter {
  display: inline-grid;
  gap: 4px;
  min-width: 220px;
}

.exclusion-monitor-table-wrap {
  max-height: min(68vh, 620px);
  overflow: auto;
  border: 1px solid rgba(27, 74, 122, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.exclusion-monitor-table td {
  vertical-align: top;
}

.exclusion-reason-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  min-width: 220px;
}

.exclusion-reason-cell__detail {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.agent-filter-drawer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  max-height: 100%;
}

.filter-box--agent-drawer {
  min-height: 0;
  overflow-y: auto;
  overflow-x: visible;
  padding: 16px;
  padding-bottom: 28px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f8fd 100%);
}

.contact-pool-list--agent {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding-bottom: 8px;
  padding-right: 4px;
  gap: 10px;
}

.agent-list-table-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: auto;
  padding: 0 0 4px;
}

.contact-pool-list--agent .pagination-bar {
  flex: 0 0 auto;
}

.contact-pool-footer--agent {
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  justify-content: center;
}

.contact-pool-footer--agent .pagination-bar {
  margin-inline: auto;
}
.filter-summary-bar--inline {
  align-items: center;
  padding: 8px 12px;
}

.filter-summary-bar--inline .pill-row {
  margin-top: 0;
}

.agent-override-toggle--inline {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.floating-filter-button--compact {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.84rem;
}

.agent-filter-drawer .filter-builder {
  display: grid;
  gap: 10px;
}

.agent-filter-drawer .filter-row-card {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.9fr) minmax(0, 1.1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
}

.agent-filter-drawer .filter-control {
  gap: 6px;
}

.agent-filter-drawer .filter-control select,
.agent-filter-drawer .filter-control input {
  width: 100%;
  min-height: 38px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.agent-filter-drawer .filter-combobox {
  z-index: 3;
}

.agent-filter-drawer .filter-combobox__menu {
  min-width: 100%;
  width: max(100%, 360px);
  max-width: min(680px, calc(100vw - 140px));
}

.agent-filter-drawer [data-filter-remove] {
  justify-self: stretch;
  min-width: 96px;
  min-height: 38px;
}

.agent-filter-drawer .filter-control > span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.agent-record-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.agent-record-toolbar__group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.agent-record-shell {
  display: grid;
  gap: 12px;
}

.detail-card--hero-compact {
  padding-block: 18px;
}

.agent-record-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
  min-height: calc(100vh - 240px);
}

.agent-record-column {
  min-height: 0;
}

.agent-record-column__header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.agent-record-column__scroll {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  padding-right: 4px;
}

.agent-record-column__scroll--center {
  gap: 14px;
}

.agent-record-column--center {
  display: grid;
  gap: 12px;
}

.agent-contact-summary {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.agent-contact-summary__identity {
  display: flex;
  gap: 12px;
  align-items: center;
}

.agent-contact-summary__identity strong,
.agent-contact-summary__identity span {
  display: block;
}

.agent-contact-summary__identity span {
  color: var(--muted);
}

.agent-contact-summary__avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent) 18%, white));
  color: var(--accent);
  font-weight: 800;
}

.agent-contact-summary__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-detail-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 4px;
}

.agent-detail-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  color: var(--muted);
  font-weight: 700;
}

.agent-detail-tab.is-active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  color: var(--accent);
}

.agent-detail-stack {
  display: grid;
  gap: 14px;
}

.agent-insight-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.agent-history-list {
  display: grid;
  gap: 10px;
}

.agent-history-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.agent-history-item p {
  margin: 4px 0 0;
  color: var(--muted);
}

.agent-record-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

.agent-record-main__content,
.agent-record-main__sidebar {
  display: grid;
  gap: 12px;
}

.agent-record-main__sidebar {
  align-self: start;
}

.agent-record-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.agent-record-grid--lower {
  align-items: start;
}

.detail-card--hero,
.detail-card--wrapup {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.detail-card--wrapup-sticky {
  position: sticky;
  top: 92px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, white) 0%, #ffffff 20%, #f7fbff 100%);
  box-shadow:
    0 22px 48px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.agent-wrapup-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.agent-wrapup-highlight {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, white), #ffffff);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
}

.agent-wrapup-highlight span {
  color: var(--muted);
}

.agent-wrapup-summary {
  display: grid;
  gap: 6px;
  padding: 12px 0 0;
  border-top: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
}

.contact-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-detail-grid,
.assignment-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.contact-form-grid {
  margin-bottom: 12px;
}

.contact-detail-grid--dense,
.assignment-fields-grid--dense {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.contact-detail-grid--single {
  grid-template-columns: 1fr;
}

.detail-card--wrapup .assignment-fields-grid--dense {
  grid-template-columns: 1fr;
}

.detail-card--wrapup textarea {
  min-height: 132px;
}

.detail-card--wrapup .assignment-actions {
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
}

.company-link-manager {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, white), #ffffff);
}

.company-link-manager__header {
  display: grid;
  gap: 4px;
}

.company-link-manager__controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.company-link-manager__controls--stacked {
  grid-template-columns: 1fr;
}

.company-link-manager__search {
  display: grid;
  gap: 6px;
}

.company-link-manager__search span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.company-link-manager__controls--stacked select {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  background: #ffffff;
}

.readonly-field-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-muted) 72%, white);
}

.readonly-field-card__label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.readonly-field-card__value {
  font-size: 0.92rem;
  line-height: 1.3;
  color: var(--ink);
}

.detail-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.field-admin-row,
.filter-row-card {
  padding: 14px;
}

.field-admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.field-admin-grid--template {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-admin-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.field-admin-actions--compact {
  margin-top: 4px;
}

.field-admin-actions--inline {
  margin-top: 0;
  justify-content: flex-end;
}

.field-admin-grid--team-inline {
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr) auto;
  align-items: end;
}

.field-admin-actions--team {
  align-self: end;
  white-space: nowrap;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.2;
}

.checkbox-line input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  display: inline-block;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.checkbox-line input[type="checkbox"]::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform 140ms ease;
}

.checkbox-line input[type="checkbox"]:checked {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  box-shadow: 0 4px 10px color-mix(in srgb, var(--accent) 20%, transparent);
}

.checkbox-line input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(1);
}

.checkbox-line input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--status-color) 14%, white);
  color: var(--ink);
  font-weight: 700;
}

.filter-row-card {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.is-clickable {
  cursor: pointer;
}

@media (max-width: 1200px) {
  .app-shell,
  .stats-grid,
  .panel-grid,
  .panel-grid--overview-top,
  .panel-grid--overview-main,
  .panel-grid--wide,
  .panel-grid--template-builder,
  .agent-layout,
  .agent-record-layout,
  .agent-record-main,
  .report-grid,
  .report-split,
  .agent-record-grid,
  .agent-project-grid,
  .contact-detail-grid,
  .assignment-fields-grid,
  .field-admin-grid,
  .field-admin-grid--template,
  .contact-columns-grid,
  .filter-row-card,
  .project-create-layout,
  .project-config-grid,
  .inline-create,
  .template-builder__grid {
    grid-template-columns: 1fr;
  }

  .agent-launcher__hero,
  .agent-launcher__hero-stats,
  .agent-workspace-overview__row {
    grid-template-columns: 1fr;
  }

  .agent-record-fact-strip,
  .agent-wrapup-kpis {
    grid-template-columns: 1fr;
  }

  .agent-record-layout--hubspot,
  .report-grid--contact-overview,
  .agent-overview-panels,
  .agent-pipeline-grid,
  .agent-record-contact-strip,
  .agent-record-workspace-kpis {
    grid-template-columns: 1fr;
  }

  .template-editor-shell__header,
  .workspace-header--template {
    flex-direction: column;
    align-items: stretch;
  }

  .template-editor-shell__body {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .query-builder-layout,
  .filter-row-card--query {
    grid-template-columns: 1fr;
  }

  .agent-record-column__scroll {
    max-height: none;
    overflow: visible;
  }

  .agent-record-layout--hubspot {
    height: auto;
    min-height: 0;
  }

  .agent-list-shell,
  .agent-list-shell.is-filter-open {
    grid-template-columns: 1fr;
  }

  .agent-workspace-overview__meta,
  .agent-workspace-overview__stats {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .agent-workspace-overview__meta {
    justify-content: flex-start;
  }

  .company-link-manager__controls {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .contact-pool-row {
    grid-template-columns: 1fr;
  }

  .contact-pool-row--header {
    display: none;
  }

  .contact-pool-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .hero,
  .section-heading,
  .workspace-section__header,
  .agent-toolbar,
  .agent-topbar,
  .detail-header,
  .detail-title,
  .assign-toolbar {
    flex-direction: column;
    align-items: start;
  }
}
.field-admin-row--log {
  padding: 14px;
  gap: 14px;
  border-left: 4px solid transparent;
}

.field-admin-row--log.is-email-error {
  border-left-color: #c84d57;
  background: linear-gradient(180deg, rgba(200, 77, 87, 0.06), rgba(255, 255, 255, 0.98));
}

.field-admin-row--log.is-email-warning {
  border-left-color: #c9850d;
  background: linear-gradient(180deg, rgba(201, 133, 13, 0.06), rgba(255, 255, 255, 0.98));
}

.field-admin-row--log.is-email-success {
  border-left-color: #198754;
  background: linear-gradient(180deg, rgba(25, 135, 84, 0.05), rgba(255, 255, 255, 0.98));
}

body.crm-theme-dark .field-admin-row--log.is-email-error {
  background: linear-gradient(180deg, rgba(200, 77, 87, 0.18), rgba(17, 24, 39, 0.95));
}

body.crm-theme-dark .field-admin-row--log.is-email-warning {
  background: linear-gradient(180deg, rgba(201, 133, 13, 0.16), rgba(17, 24, 39, 0.95));
}

body.crm-theme-dark .field-admin-row--log.is-email-success {
  background: linear-gradient(180deg, rgba(25, 135, 84, 0.16), rgba(17, 24, 39, 0.95));
}

.field-admin-actions--log {
  align-items: flex-start;
}

.log-card__identity {
  display: grid;
  gap: 6px;
}

.log-card__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.log-card__title-row strong {
  min-width: 0;
  flex: 1 1 auto;
}

.log-card__title-row .ghost-button {
  flex: 0 0 auto;
}

.field-admin-grid__full {
  grid-column: 1 / -1;
}

.field-admin-grid__full--actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.field-admin-grid__full--actions .ghost-button {
  min-width: 160px;
}

@media (max-width: 820px) {
  .log-card__title-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

#email-logs .filter-row {
  grid-template-columns: minmax(260px, 1.6fr) repeat(4, minmax(140px, 1fr));
}

.saved-search-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.saved-search-library-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.saved-search-library-header label {
  flex: 1;
}

.saved-search-library {
  display: grid;
  gap: 10px;
}

.saved-search-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

body.crm-theme-dark .saved-search-card {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(15, 23, 42, 0.98));
}

.saved-search-card__main {
  display: grid;
  gap: 8px;
}

.saved-search-card__name {
  display: grid;
  gap: 6px;
}

.saved-search-card__title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.saved-search-card__name input {
  min-height: 40px;
}

.saved-search-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.saved-search-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.scriptlet-builder-shell {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.scriptlet-builder {
  display: grid;
  gap: 12px;
}

.scriptlet-builder__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.scriptlet-builder__steps {
  display: grid;
  gap: 12px;
}

.scriptlet-step {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.scriptlet-step__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.scriptlet-step__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.scriptlet-step__label-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.scriptlet-help-button {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  font-weight: 700;
}

.scriptlet-step__toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.scriptlet-step.is-disabled {
  opacity: 0.7;
}

.scriptlet-step__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.scriptlet-step__hint {
  display: grid;
  align-items: center;
  min-height: 46px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.92rem;
}

body.crm-theme-dark .scriptlet-builder-shell,
body.crm-theme-dark .scriptlet-step {
  background: #0f1a2d;
  border-color: var(--line);
}

@media (max-width: 1024px) {
  .scriptlet-step__grid,
  .scriptlet-builder__header {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

/* HubSpot-inspired system refresh */

:root {
  --bg: #f3f7fb;
  --bg-strong: #e8eff6;
  --surface: #ffffff;
  --surface-soft: #f8fbfe;
  --surface-muted: #eef4f9;
  --ink: #213343;
  --muted: #6a7a8c;
  --line: #d7e3f0;
  --line-strong: #bfd1e3;
  --accent: #ff7a59;
  --accent-soft: rgba(255, 122, 89, 0.1);
  --accent-strong: #e66a4a;
  --shadow: 0 14px 36px rgba(33, 51, 67, 0.08);
  --shadow-soft: 0 4px 14px rgba(33, 51, 67, 0.05);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
}

body {
  background:
    linear-gradient(180deg, #f6f9fc 0%, #edf3f8 100%);
  color: var(--ink);
}

body.crm-theme-dark {
  --bg: #0e1726;
  --bg-strong: #101c2d;
  --surface: #132033;
  --surface-soft: #172538;
  --surface-muted: #1a2b41;
  --ink: #eef4fb;
  --muted: #9fb2c8;
  --line: #2a3c55;
  --line-strong: #39506d;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.app-shell {
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  min-height: 100vh;
}

.main-panel {
  gap: 14px;
}

.sidebar {
  padding: 14px 12px 12px;
  gap: 12px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, #20334a 0%, #18293d 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.26);
}

body.crm-theme-light .sidebar,
body:not(.crm-theme-dark) .sidebar {
  background:
    linear-gradient(180deg, #21364e 0%, #1c2f45 100%);
  color: #eff4fb;
}

body.crm-theme-light .nav-chip,
body.crm-theme-light .nav-subchip,
body:not(.crm-theme-dark) .nav-chip,
body:not(.crm-theme-dark) .nav-subchip {
  color: #dce8f6;
}

body.crm-theme-light .nav-submenu-label,
body:not(.crm-theme-dark) .nav-submenu-label,
body.crm-theme-light .sidebar .eyebrow,
body.crm-theme-light .sidebar .card-label,
body:not(.crm-theme-dark) .sidebar .eyebrow,
body:not(.crm-theme-dark) .sidebar .card-label,
body.crm-theme-light .brand-copy,
body:not(.crm-theme-dark) .brand-copy {
  color: #9fb2c7;
}

body.crm-theme-light .brand-title,
body:not(.crm-theme-dark) .brand-title {
  color: #ffffff;
}

body.crm-theme-light .nav-chip.is-active,
body:not(.crm-theme-dark) .nav-chip.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(255, 122, 89, 0.28), rgba(255, 255, 255, 0.08));
  border-color: rgba(255, 255, 255, 0.12);
}

body.crm-theme-light .nav-subchip.is-active,
body:not(.crm-theme-dark) .nav-subchip.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.08);
}

body.crm-theme-light .sidebar-card,
body:not(.crm-theme-dark) .sidebar-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

body.crm-theme-light .sidebar-card .ghost-button,
body:not(.crm-theme-dark) .sidebar-card .ghost-button {
  background: rgba(255, 255, 255, 0.08);
  color: #eef4fb;
  border-color: rgba(255, 255, 255, 0.08);
}

.brand-block {
  gap: 8px;
  padding: 6px 8px 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(255, 122, 89, 0.28);
}

.brand-title {
  font-size: 1.08rem;
}

.brand-copy {
  font-size: 0.84rem;
  line-height: 1.45;
}

.sidebar-nav-shell {
  padding: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-nav {
  gap: 4px;
}

.nav-group {
  gap: 4px;
  padding-top: 2px;
}

.nav-chip,
.nav-subchip {
  border-radius: 10px;
}

.nav-chip {
  padding: 8px 10px;
  font-size: 0.88rem;
}

.nav-subchip {
  padding: 7px 10px;
  font-size: 0.85rem;
}

.nav-submenu {
  gap: 4px;
  padding-left: 10px;
}

.nav-submenu-label {
  padding: 8px 10px 2px;
}

.sidebar-bottom {
  gap: 10px;
}

.sidebar-card {
  padding: 12px;
  border-radius: 14px;
}

.snapshot-line {
  padding: 8px 0;
}

.hero {
  min-height: auto;
  padding: 10px 14px;
  border-radius: 16px;
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  background: linear-gradient(180deg, #2b4057 0%, #23384e 100%);
  border: 1px solid rgba(20, 35, 53, 0.18);
  box-shadow: 0 8px 18px rgba(33, 51, 67, 0.12);
}

.hero .eyebrow {
  margin-bottom: 2px;
  font-size: 0.68rem;
}

.hero h2 {
  font-size: 1.02rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-actions {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

#globalSearch {
  min-width: 0;
  height: 40px;
  border-radius: 10px;
}

.panel-section {
  gap: 12px;
}

.panel-section--full {
  min-height: calc(100vh - 146px);
}

.stats-grid,
.panel-grid,
.agent-layout,
.report-split {
  gap: 12px;
}

.stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.panel-grid {
  grid-template-columns: 290px 1fr;
}

.panel-grid--wide,
.panel-grid--database-settings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-grid--reporting {
  grid-template-columns: minmax(290px, 0.8fr) minmax(0, 1.2fr);
}

.workspace-shell,
.workspace-section,
.detail-card,
.project-config-box,
.template-preview-card {
  padding: 16px;
}

.stat-card,
.list-card,
.assignment-row,
.agent-panel,
.field-admin-row {
  padding: 12px;
}

.stat-card {
  min-height: 92px;
}

.stat-card p {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.stat-card h3 {
  margin-top: 8px;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.section-heading,
.workspace-section__header,
.workspace-header,
.detail-header,
.detail-title,
.agent-topbar,
.agent-record-toolbar {
  gap: 8px;
}

.section-heading {
  padding-bottom: 10px;
  margin-bottom: 2px;
}

.section-kicker,
.eyebrow,
.card-label {
  font-size: 0.67rem;
  letter-spacing: 0.11em;
}

.section-heading h3,
.workspace-section__header h4,
.entry-form h4,
.admin-title,
.detail-title h4,
.workspace-shell h4,
.workspace-section h4 {
  font-size: 1.02rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.workspace-copy,
.project-config-box__copy,
.list-card__subtitle,
.list-card__meta,
.detail-caption,
.report-item__meta,
.feature-line span,
.report-item p {
  font-size: 0.86rem;
}

input,
select,
textarea {
  min-height: 38px;
  border-radius: 10px;
  padding: 9px 12px;
  background: #ffffff;
}

textarea {
  min-height: 92px;
}

.ghost-button,
.ghost-link,
.primary-button,
.secondary-button,
.danger-button,
.entry-form button,
.assign-toolbar button {
  min-height: 36px;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 700;
}

.ghost-button,
.ghost-link,
.secondary-button {
  background: #ffffff;
  border: 1px solid var(--line);
}

.primary-button,
.entry-form button,
.assign-toolbar button {
  box-shadow: none;
}

.danger-button {
  border: 1px solid rgba(198, 69, 80, 0.16);
}

.badge,
.status-pill,
.workspace-header__meta .badge {
  padding: 0;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.workspace-tabs {
  gap: 6px;
  padding-top: 2px;
}

.workspace-tab {
  border-radius: 10px;
  min-height: 34px;
  padding: 7px 11px;
  font-size: 0.84rem;
  background: #ffffff;
}

.workspace-tab.is-active {
  background: #eaf2fb;
  color: #204d74;
  border-color: #c9d8e8;
}

.filter-box {
  padding: 12px;
  gap: 10px;
  background: #f8fbfe;
}

.filter-builder,
.filter-row {
  gap: 10px;
}

.filter-row-card {
  padding: 10px;
  grid-template-columns: 1.25fr 0.95fr 0.95fr auto;
}

.filter-control > span {
  font-size: 0.68rem;
}

.filter-summary-bar {
  padding: 9px 12px;
}

.crm-list-toolbar {
  padding: 10px 12px;
  border-radius: 12px 12px 0 0;
  background: #f7fafc;
  border-bottom: none;
}

.crm-list-toolbar__title h4 {
  font-size: 0.95rem;
}

.crm-table-shell {
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

.contact-pool-list {
  gap: 10px;
}

.contact-pool-table {
  gap: 0;
}

.contact-pool-row {
  min-height: 36px;
  padding: 4px 10px;
  gap: 10px;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  box-shadow: none;
}

.contact-pool-row:first-child {
  border-top: 1px solid var(--line);
}

.contact-pool-row:hover {
  background: #f8fbfe;
}

.contact-pool-row--header {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 38px;
  padding: 0 10px;
  background: #f5f8fb;
}

.contact-pool-row--header span {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: #587086;
}

.contact-pool-row > span {
  font-size: 0.8rem;
}

.contact-pool-cell,
.contact-pool-cell--primary {
  min-width: 0;
}

.contact-pool-cell--primary {
  font-weight: 700;
  color: #1f4e79;
}

.contact-pool-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 0.68rem;
}

.contact-pool-identity {
  gap: 8px;
}

.contact-pool-identity__text {
  gap: 2px;
}

.contact-pool-actions {
  gap: 6px;
}

.contact-pool-actions select,
.contact-pool-actions button {
  min-height: 30px;
  font-size: 0.78rem;
}

.assign-toolbar {
  gap: 8px;
}

.pagination-page {
  min-width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 0.82rem;
}

.report-grid,
.report-grid--dense {
  gap: 12px;
}

.report-item,
.feature-line {
  padding: 14px;
}

.workspace-empty {
  padding: 16px;
  border-style: solid;
  border-color: var(--line);
  background: #f8fbfe;
}

.agent-layout {
  grid-template-columns: 1fr;
}

.agent-project-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.agent-project-card {
  padding: 14px;
  gap: 10px;
}

.agent-project-card h4 {
  font-size: 1rem;
}

.agent-topbar,
.agent-record-toolbar {
  padding: 10px 12px;
}

.detail-shell,
.agent-record-shell,
.workspace-panel {
  gap: 10px;
}

.detail-card {
  gap: 10px;
}

.detail-card--hero,
.detail-card--wrapup {
  background: #ffffff;
}

.detail-card--wrapup-sticky {
  position: static;
  top: auto;
}

.detail-title h4 {
  font-size: 1.12rem;
}

.agent-override-banner {
  padding: 12px 14px;
  border-radius: 12px;
}

.field-admin-row,
.field-admin-row--log {
  padding: 12px;
}

.contact-columns-grid {
  gap: 10px;
}

.contact-columns-option {
  padding: 10px 12px;
}

.modal-card {
  border-radius: 16px;
}

.modal-card--response {
  width: min(1180px, calc(100vw - 40px));
  max-height: min(90vh, 1080px);
  overflow: auto;
}

.entry-form--response {
  display: grid;
  gap: 18px;
}

.response-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 18px;
}

.response-modal-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.response-modal-panel__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.response-toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.response-toggle-grid .checkbox-line {
  min-height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.response-scriptlet-shell {
  padding: 18px;
}

.response-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.response-editor-shell {
  display: grid;
  gap: 14px;
}

.response-editor-basics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.response-editor-basics-main {
  display: grid;
  gap: 14px;
}

.response-editor-step {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.response-editor-step__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.response-editor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.response-editor-grid--identity {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.response-editor-grid--identity > label:nth-child(1),
.response-editor-grid--identity > label:nth-child(2) {
  grid-column: span 2;
}

.response-editor-grid__full {
  grid-column: 1 / -1;
}

.response-editor-help {
  margin-top: -4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.response-editor-side-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.response-editor-side-card__header {
  display: grid;
  gap: 4px;
}

.response-editor-side-card__header h5 {
  margin: 0;
}

.response-editor-side-card__body {
  display: grid;
  gap: 12px;
}

.response-editor-side-card__split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.response-project-codes-field .multi-select-picker[data-variant="import-mapping"] .multi-select-picker__trigger {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 0.72rem 0.9rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.response-project-codes-field .multi-select-picker[data-variant="import-mapping"] .multi-select-picker__dropdown {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
}

.response-project-codes-field .multi-select-picker[data-variant="import-mapping"] .multi-select-picker__search-input {
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 42px;
  padding: 0.7rem 0.85rem;
}

.response-project-codes-field .multi-select-picker[data-variant="import-mapping"] .multi-select-option {
  min-height: 42px;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: #fff;
  color: #1f2937;
  border: 1px solid transparent;
}

.response-project-codes-field .multi-select-picker[data-variant="import-mapping"] .multi-select-option:hover,
.response-project-codes-field .multi-select-picker[data-variant="import-mapping"] .multi-select-option.is-selected {
  background: #f8fbff;
  color: #1f2937;
  border-color: color-mix(in srgb, var(--accent) 16%, var(--line));
}

.response-project-codes-field .multi-select-picker[data-variant="import-mapping"] .multi-select-option__check {
  color: var(--accent);
}

.response-project-codes-field .multi-select-picker[data-variant="import-mapping"] .multi-select-picker__actions .secondary-button {
  background: #fff;
  color: #1f2937;
  border: 1px solid var(--line);
  box-shadow: none;
}

.response-project-codes-field .multi-select-picker[data-variant="import-mapping"] .multi-select-picker__actions .secondary-button:hover {
  background: #f8fbff;
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
}

.response-sequence-builder {
  display: grid;
  gap: 12px;
}

.response-sequence-step {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.response-sequence-step__header,
.response-sequence-step__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.response-sequence-step__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.response-sequence-combobox .filter-combobox__menu {
  max-height: 260px;
  overflow-y: auto;
}

.response-sequence-inline {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 8px;
}

.response-review-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  padding: 14px;
}

.response-review-controls {
  display: grid;
  grid-template-columns: minmax(160px, 220px) repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.response-review-controls .checkbox-line {
  min-height: 44px;
}

.response-sequence-add-action {
  margin-top: 8px;
}

.response-action-button {
  min-height: 44px;
  flex: 0 0 auto;
}

.response-action-button--test {
  background: linear-gradient(180deg, #eef6ff 0%, #dfeefe 100%) !important;
  border-color: #bfd6f3 !important;
  color: #18466f !important;
}

.response-action-button--test:hover {
  background: linear-gradient(180deg, #dcecff 0%, #cfe3fb 100%) !important;
}

.response-action-button--delete {
  min-width: 150px;
}

.response-action-button--save {
  min-width: 160px;
}

.response-modal-actions--sticky {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: 12px -16px -16px;
  padding: 14px 16px;
  background: #f8fbff;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.response-modal-actions {
  justify-content: space-between;
  align-items: center;
}

.response-modal-actions__left,
.response-modal-actions__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.crm-theme-dark .response-modal-actions--sticky {
  background: #132033;
  border-top-color: rgba(255, 255, 255, 0.08);
}

.report-builder-actions--sticky {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: 12px -16px -16px;
  padding: 14px 16px;
  background: #f8fbff;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  justify-content: flex-end;
}

.report-builder-actions--sticky #reportBuilderBackButton {
  background: linear-gradient(180deg, #eef3f8 0%, #dde6ef 100%);
  border-color: rgba(107, 129, 154, 0.28);
  color: #27415c;
}

.report-builder-actions--sticky #reportBuilderNextButton,
.report-builder-actions--sticky .primary-button[type="submit"] {
  background: linear-gradient(180deg, #1fa766 0%, #118553 100%);
  border-color: rgba(14, 122, 76, 0.56);
  color: #ffffff;
}

.report-builder-actions--sticky #reportBuilderBackButton:hover {
  background: linear-gradient(180deg, #e4ebf3 0%, #d4dfea 100%);
  border-color: rgba(107, 129, 154, 0.38);
}

.report-builder-actions--sticky #reportBuilderNextButton:hover,
.report-builder-actions--sticky .primary-button[type="submit"]:hover {
  background: linear-gradient(180deg, #19975c 0%, #0e7346 100%);
  border-color: rgba(14, 122, 76, 0.72);
}

body.crm-theme-dark .report-builder-actions--sticky {
  background: #132033;
  border-top-color: rgba(255, 255, 255, 0.08);
}

.response-search {
  min-width: 260px;
}

.response-list-row {
  width: 100%;
  display: grid;
  gap: 10px;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: none;
}

.response-list-row:hover {
  background: #f8fbfe;
  border-color: var(--line-strong);
}

.response-list-row.is-selected {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, white);
}

#agentReviewExcludedButton.is-active {
  background: color-mix(in srgb, var(--accent) 18%, white);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  color: color-mix(in srgb, var(--accent) 92%, #12304f);
  box-shadow: 0 10px 24px rgba(13, 110, 253, 0.14);
}

#agentReviewExcludedButton.is-active:hover {
  background: color-mix(in srgb, var(--accent) 24%, white);
}

.response-list-row__main,
.response-list-row__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.response-list-row__main {
  align-items: start;
}

.response-list-row__main--inline {
  align-items: center;
}

#adminProjectList .response-list-row {
  width: 100%;
  text-align: left;
}

.response-list-row__content {
  flex: 1;
  border: none;
  background: transparent;
  text-align: left;
  color: inherit;
  padding: 0;
}

.response-list-row__main strong {
  display: block;
  font-size: 0.94rem;
}

.response-list-row__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.response-list-row__main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.response-list-row__meta {
  flex-wrap: wrap;
}

.response-list-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.response-list-row__actions--inline {
  justify-content: flex-end;
}

.response-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

body.crm-theme-dark .contact-pool-row--header,
body.crm-theme-dark .crm-list-toolbar,
body.crm-theme-dark .pagination-bar,
body.crm-theme-dark .filter-box,
body.crm-theme-dark .workspace-empty,
body.crm-theme-dark .report-table th {
  background: #222c3b;
}

body.crm-theme-dark .workspace-tab {
  background: #222c3b;
}

body.crm-theme-dark .workspace-tab.is-active {
  background: rgba(127, 180, 255, 0.14);
  color: #eaf2fd;
  border-color: rgba(127, 180, 255, 0.18);
}

body.crm-theme-dark .ghost-button,
body.crm-theme-dark .secondary-button,
body.crm-theme-dark .ghost-link {
  background: #222c3b;
}

body.crm-theme-dark .hero {
  background: var(--shell-nav-surface);
}

body.crm-theme-dark .report-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

body.crm-theme-dark .response-list-row {
  background: #1d2735;
}

body.crm-theme-dark .response-list-row:hover {
  background: #243041;
}

body.crm-theme-dark .response-list-row.is-selected {
  background: rgba(127, 180, 255, 0.12);
}

body.crm-theme-dark .response-modal-panel,
body.crm-theme-dark .response-scriptlet-shell,
body.crm-theme-dark .response-editor-side-card {
  background: #1d2735;
  border-color: var(--line);
}

body.crm-theme-dark .response-toggle-grid .checkbox-line {
  background: #243041;
  border-color: var(--line);
}

body.crm-theme-dark .response-list-row__content {
  color: var(--ink);
}

body.crm-theme-dark .response-tag {
  background: #243041;
}

body.crm-theme-dark #agentReviewExcludedButton.is-active {
  background: color-mix(in srgb, var(--accent) 26%, rgba(255, 255, 255, 0.05));
  color: #dbeafe;
}

@media (max-width: 1100px) {
  .response-modal-grid,
  .response-modal-panel__grid,
  .response-toggle-grid,
  .response-editor-basics-layout,
  .response-editor-grid,
  .response-sequence-step__grid,
  .response-review-controls,
  .saved-search-card {
    grid-template-columns: 1fr;
  }

  .saved-search-create-row,
  .saved-search-library-header {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .response-editor-side-card__split {
    grid-template-columns: 1fr;
  }

  .response-modal-actions {
    justify-content: stretch;
  }

  .response-action-button {
    flex: 1 1 calc(50% - 10px);
  }
}

@media (max-width: 640px) {
  .response-action-button {
    flex: 1 1 100%;
  }
}

@media (max-width: 1400px) {
  .agent-project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

html {
  scroll-behavior: smooth;
}

body,
.sidebar,
.nav-chip,
.nav-subchip,
.ghost-button,
.secondary-button,
.primary-button,
.modal-card,
.contact-pool-row,
.queue-row,
.workspace-shell,
.detail-card {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 220ms ease,
    transform 220ms ease,
    opacity 180ms ease,
    width 220ms ease,
    padding 220ms ease;
}

body {
  font-family: "Inter", "Plus Jakarta Sans", sans-serif;
}

.hero h2,
.section-heading h3,
.entry-form h4,
.workspace-section__header h4,
.admin-title,
.brand-title,
.global-topbar h2 {
  font-family: "Manrope", "Lexend", sans-serif;
}

.app-shell {
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  min-height: 100vh;
}

.sidebar {
  padding: 12px;
  gap: 12px;
  border-radius: 0;
  height: 100vh;
  top: 0;
  background: linear-gradient(180deg, rgba(18, 35, 58, 0.985) 0%, rgba(19, 37, 61, 0.985) 100%);
}

.sidebar-nav-shell {
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--nav-line);
}

.sidebar-nav {
  gap: 8px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-submenu {
  display: grid;
  gap: 4px;
  padding: 8px 0 0 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: max-height 220ms ease, opacity 180ms ease, transform 220ms ease, padding 220ms ease;
}

.nav-group.is-expanded .nav-submenu {
  max-height: 520px;
  opacity: 1;
  overflow: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-submenu-label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  padding: 2px 10px 0;
}

.nav-chip,
.nav-subchip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-chip {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  justify-content: space-between;
}

.nav-subchip {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
}

.nav-chip__icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  flex: 0 0 22px;
}

.nav-chip__label {
  min-width: 0;
  flex: 1 1 auto;
}

.nav-chip--group::after {
  content: "›";
  font-size: 1rem;
  color: var(--nav-muted);
  transform: rotate(0deg);
  transition: transform 180ms ease, color 180ms ease;
}

.nav-group.is-expanded .nav-chip--group::after {
  transform: rotate(90deg);
  color: currentColor;
}

.nav-subchip--child {
  padding-left: 26px;
}

.nav-subchip.is-active,
.nav-chip.is-active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 22px rgba(15, 23, 42, 0.12);
}

.main-panel {
  min-width: 0;
  padding: 0;
}

.hero {
  display: none;
}

.global-topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 8px 16px;
  max-height: 75px;
  margin-bottom: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(219, 230, 243, 0.9);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

.global-topbar__left,
.global-topbar__middle,
.global-topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: nowrap;
}

.global-topbar__middle {
  justify-content: flex-start;
  gap: 8px;
}

.topbar-context {
  min-width: 0;
}

.topbar-context .eyebrow {
  margin-bottom: 2px;
}

.global-topbar h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.topbar-icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}

.topbar-action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.topbar-context-actions,
.topbar-context-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.topbar-context-actions {
  width: 100%;
  justify-content: flex-end;
}

.topbar-context-chip {
  display: inline-grid;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.topbar-context-chip__label {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar-context-chip__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.topbar-context-chip strong {
  font-size: 0.86rem;
  line-height: 1.1;
  white-space: nowrap;
}

.topbar-context-cluster {
  justify-content: flex-end;
  flex-shrink: 0;
}

.topbar-context-cluster .secondary-button--compact {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.secondary-button--compact {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
}

.user-menu {
  position: relative;
}

.notification-center {
  position: relative;
}

.notification-bell {
  position: relative;
  min-width: 44px;
  min-height: 42px;
  padding: 8px 12px;
}

.notification-bell.is-unread {
  border-color: rgba(200, 77, 87, 0.34);
  background: rgba(200, 77, 87, 0.08);
  color: #c84d57;
}

.notification-bell__icon {
  font-size: 1rem;
  line-height: 1;
}

.notification-bell__count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: #c84d57;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, 82vw);
  padding: 10px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 10px;
  z-index: 40;
}

.notification-dropdown.is-hidden {
  display: none;
}

.notification-dropdown__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 2px 4px 0;
}

.notification-dropdown__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-dropdown__body {
  display: grid;
  gap: 8px;
  max-height: min(420px, 65vh);
  overflow: auto;
}

.notification-entry {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.notification-entry.is-unread {
  border-color: #d7e4f4;
  background: #f8fbff;
}

.notification-entry--danger {
  box-shadow: inset 3px 0 0 #c84d57;
}

.notification-entry--warning {
  box-shadow: inset 3px 0 0 #c9850d;
}

.notification-entry__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.notification-entry__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-dropdown__clear,
.notification-entry__clear {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0;
}

.notification-dropdown__actions .notification-dropdown__clear {
  color: var(--ink);
}

.notification-entry p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.user-menu-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 12px;
}

.user-menu-button__avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, white);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: 8px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 4px;
}

.user-menu-dropdown.is-hidden {
  display: none;
}

.user-menu-dropdown__item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  color: var(--ink);
}

.user-menu-dropdown__item:hover {
  background: var(--surface-soft);
  border-color: var(--line);
}

.user-menu-dropdown__item--danger {
  color: var(--danger);
}

#globalSearch {
  min-width: min(144px, 14vw);
  width: min(144px, 14vw);
  max-width: 144px;
  padding-top: 7px;
  padding-bottom: 7px;
  background: var(--surface-soft);
  color: var(--ink);
  border-color: var(--line);
}

#globalSearch::placeholder {
  color: var(--muted);
}

.panel-grid--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-section {
  padding: 16px;
}

.sidebar-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.sidebar-toggle-button {
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.global-topbar #sidebarToggleButton {
  display: none !important;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 88px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  padding-inline: 10px;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .brand-meta,
body.sidebar-collapsed .nav-chip__label,
body.sidebar-collapsed .nav-submenu,
body.sidebar-collapsed .nav-submenu-label,
body.sidebar-collapsed .nav-chip--group::after {
  display: none !important;
}

body.sidebar-collapsed .brand-mark-row {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-nav-shell {
  padding: 8px 6px;
}

body.sidebar-collapsed .nav-chip {
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .nav-chip__icon {
  width: 28px;
  height: 28px;
  font-size: 0.82rem;
}

body.sidebar-collapsed .nav-group {
  justify-items: center;
}

body.sidebar-collapsed .nav-chip--group {
  background: rgba(255, 255, 255, 0.05);
}

body.sidebar-collapsed .brand-block {
  padding-inline: 0;
}

body.sidebar-collapsed .sidebar-toggle-button {
  min-width: 0;
  padding-inline: 0;
}

.modal-shell--stacked-left,
.modal-shell--stacked-right {
  place-items: stretch;
  padding: 0;
}

.modal-shell--stacked-left .modal-backdrop {
  background: rgba(14, 27, 45, 0.24);
}

.modal-shell--stacked-left .modal-card,
.modal-shell--stacked-right .modal-card {
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  overflow: auto;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06), 0 24px 50px rgba(15, 23, 42, 0.18);
}

.modal-shell--stacked-left .modal-card {
  margin-right: auto;
  width: min(58vw, 880px);
  border-right: 1px solid var(--line);
}

.modal-shell--stacked-right {
  z-index: 30;
  pointer-events: none;
}

.modal-shell--stacked-right .modal-backdrop {
  display: none;
}

.modal-shell--stacked-right .modal-card {
  margin-left: auto;
  width: min(42vw, 700px);
  border-left: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 3%, white), rgba(255, 255, 255, 0.98));
  pointer-events: auto;
}

.contact-pool-row {
  min-height: 46px;
  padding-block: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 0;
  box-shadow: none;
}

.contact-pool-row:hover {
  background: color-mix(in srgb, var(--accent) 4%, white);
}

.contact-pool-row--status {
  border-color: color-mix(in srgb, var(--contact-status-color) 34%, var(--line));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--contact-status-color) 24%, white) 0%,
    color-mix(in srgb, var(--contact-status-color) 18%, #f7fbff) 100%
  );
}

.contact-pool-row--status:hover {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--contact-status-color) 30%, white) 0%,
    color-mix(in srgb, var(--contact-status-color) 22%, #f4f9ff) 100%
  );
}

.contact-pool-cell {
  font-size: 0.88rem;
  line-height: 1.25;
}

.contact-pool-cell--primary strong {
  font-size: 0.9rem;
}

.contact-pool-row > span,
.contact-pool-cell,
.contact-pool-cell--primary,
.contact-pool-actions,
.contact-pool-actions > * {
  white-space: nowrap;
}

.contact-pool-cell,
.contact-pool-cell--primary,
.contact-pool-actions {
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-pool-identity {
  min-width: 0;
  flex-wrap: nowrap;
}

.contact-pool-identity__text {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-pool-actions {
  flex-wrap: nowrap;
}

.floating-filter-actions {
  position: fixed;
  right: 16px;
  bottom: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
}

.floating-filter-button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, white), #ffffff);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  color: var(--ink);
  font-weight: 700;
}

.floating-filter-button--secondary {
  background: linear-gradient(180deg, #ffffff, #f7faff);
}

.floating-filter-link {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

body.crm-theme-dark .global-topbar {
  background: var(--shell-nav-surface);
  color: var(--ink);
  border-color: var(--line);
}

body.crm-theme-dark .user-menu-dropdown {
  background: #202a38;
  border-color: var(--line);
}

body.crm-theme-dark #globalSearch {
  background: #273244;
  color: var(--ink);
  border-color: var(--line);
}

body.crm-theme-dark .global-search-results {
  background: rgba(28, 38, 52, 0.98);
  border-color: rgba(90, 109, 132, 0.72);
}

body.crm-theme-dark .global-search-result {
  background: linear-gradient(180deg, #212b3a 0%, #1b2431 100%);
  color: var(--ink);
}

body.crm-theme-dark .global-search-result:hover,
body.crm-theme-dark .global-search-result:focus {
  background: rgba(127, 180, 255, 0.14);
}

@media (max-width: 1180px) {
  .global-topbar {
    grid-template-columns: 1fr;
  }

  .global-topbar__middle {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .panel-grid--triple {
    grid-template-columns: 1fr;
  }

  .modal-shell--stacked-left .modal-card,
  .modal-shell--stacked-right .modal-card {
    width: 100vw;
  }

  #globalSearch {
    width: 180px;
    max-width: 180px;
    min-width: 180px;
  }
}

/* HubSpot-inspired shell overhaul */
:root {
  --shell-sidebar-width: 244px;
  --shell-sidebar-collapsed-width: 72px;
  --shell-topbar-height: 65px;
  --shell-nav-surface: linear-gradient(180deg, #213a5a 0%, #1f3654 100%);
  --shell-nav-border: rgba(255, 255, 255, 0.08);
  --shell-nav-text: #eef5ff;
  --shell-nav-muted: rgba(231, 239, 248, 0.68);
  --hubspot-bg: #f5f8fa;
  --hubspot-surface: #ffffff;
  --hubspot-surface-alt: #f7fafc;
  --hubspot-border: #dfe7ef;
  --hubspot-border-strong: #c7d3e0;
  --hubspot-text: #213343;
  --hubspot-muted: #587387;
  --hubspot-blue: #2d8cff;
  --hubspot-blue-strong: #1273ea;
  --hubspot-navy: #243b53;
  --hubspot-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px rgba(15, 23, 42, 0.06);
}

body {
  background: var(--hubspot-bg);
  color: var(--hubspot-text);
  overflow: hidden;
  font-family: "Inter", "Plus Jakarta Sans", sans-serif;
}

body.crm-theme-dark {
  --hubspot-bg: #11161f;
  --hubspot-surface: #1a2230;
  --hubspot-surface-alt: #202b3b;
  --hubspot-border: #2f3c51;
  --hubspot-border-strong: #42526a;
  --hubspot-text: #e6edf7;
  --hubspot-muted: #9aa9bd;
  --hubspot-blue: #7fb4ff;
  --hubspot-blue-strong: #5a9bff;
  --hubspot-navy: #171f2b;
  --hubspot-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  --surface-muted: #253244;
  --shell-nav-surface: linear-gradient(180deg, #18212e 0%, #141c28 100%);
  --shell-nav-border: rgba(148, 163, 184, 0.1);
  --shell-nav-text: #e8eef8;
  --shell-nav-muted: rgba(168, 182, 202, 0.78);
}

body,
body.crm-theme-light,
body:not(.crm-theme-dark) {
  --surface: var(--hubspot-surface);
  --surface-soft: var(--hubspot-surface-alt);
  --surface-muted: #eef3f8;
  --line: var(--hubspot-border);
  --line-strong: var(--hubspot-border-strong);
  --ink: var(--hubspot-text);
  --muted: var(--hubspot-muted);
  --accent: #ff7a59;
  --accent-strong: #ea5c3d;
  --shadow: var(--hubspot-shadow);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
}

.app-shell {
  height: 100vh;
  min-height: 100vh;
  grid-template-columns: var(--shell-sidebar-width) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  background: var(--hubspot-bg);
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: stretch;
  height: 100vh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 0;
  border-right: 1px solid var(--shell-nav-border);
  border-radius: 0;
  overflow: hidden;
  background: var(--shell-nav-surface);
  box-shadow: none;
}

.sidebar-top {
  min-height: 0;
  padding: 12px 12px 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.brand-block {
  padding: 10px 12px 12px;
  border-radius: 0;
  border: 0;
  background: transparent;
}

.brand-mark-row {
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff7a59 0%, #ff5c35 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: none;
}

.brand-meta .eyebrow,
.sidebar .eyebrow,
.sidebar .card-label {
  color: var(--shell-nav-muted);
}

.brand-title {
  margin: 2px 0 0;
  color: #ffffff;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-copy {
  margin: 8px 0 0;
  color: rgba(230, 239, 250, 0.72);
  font-size: 0.86rem;
  line-height: 1.5;
}

.sidebar-nav-shell {
  min-height: 0;
  overflow: auto;
  padding: 8px 6px 12px;
  border-radius: 0;
  border: 0;
  background: transparent;
  scrollbar-width: thin;
}

.sidebar-nav-shell::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav-shell::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.sidebar-nav {
  gap: 5px;
}

.nav-group {
  gap: 4px;
}

.nav-chip,
.nav-subchip {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: rgba(241, 245, 249, 0.84);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.nav-chip {
  padding: 8px 10px;
  font-size: 0.92rem;
  font-weight: 600;
}

.nav-subchip {
  padding: 7px 12px;
  font-size: 0.84rem;
  font-weight: 500;
  color: rgba(214, 226, 241, 0.78);
}

.nav-chip:hover,
.nav-subchip:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-chip.is-active,
.nav-subchip.is-active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: none;
}

.nav-chip__icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 0.68rem;
}

.nav-submenu {
  gap: 3px;
  padding: 6px 0 2px 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-submenu-label {
  padding: 4px 10px 2px;
  color: rgba(214, 226, 241, 0.54);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
}

.sidebar-bottom {
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-toggle-button {
  width: 100%;
  min-height: 36px;
  border-radius: 9px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.sidebar-toggle-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.main-panel {
  min-width: 0;
  min-height: 100vh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: var(--shell-topbar-height) minmax(0, 1fr);
  overflow: hidden;
  background: var(--hubspot-bg);
}

.global-topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: var(--shell-topbar-height);
  height: var(--shell-topbar-height);
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 4px 15px;
  border: 0;
  border-bottom: 1px solid var(--shell-nav-border);
  border-radius: 0;
  margin: 0;
  background: var(--shell-nav-surface);
  box-shadow: none;
  backdrop-filter: none;
}

.global-topbar__left,
.global-topbar__middle,
.global-topbar__right {
  min-width: 0;
  gap: 10px;
}

.global-topbar__left {
  justify-content: flex-start;
}

.global-topbar__middle {
  justify-content: flex-start;
}

.global-topbar__right {
  justify-content: flex-end;
}

.topbar-context .eyebrow {
  margin: 0 0 2px;
  color: var(--shell-nav-muted);
}

.global-topbar h2 {
  color: var(--shell-nav-text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.05;
}

#topbarTitle {
  color: var(--shell-nav-text) !important;
}

#globalSearch {
  width: min(420px, 100%);
  min-width: 240px;
  max-width: 420px;
  height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

#globalSearch::placeholder {
  color: rgba(233, 241, 251, 0.72);
}

#globalSearch:focus {
  outline: none;
  border-color: rgba(147, 197, 253, 0.6);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22);
}

.global-search-shell {
  position: relative;
  width: min(420px, 100%);
  min-width: 240px;
  max-width: 420px;
}

.global-search-shell #globalSearch {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 2500;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(203, 215, 229, 0.95);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(12px);
}

.global-search-results.is-hidden {
  display: none;
}

.global-search-results__section {
  display: grid;
  gap: 6px;
}

.global-search-result {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  color: var(--ink);
}

.global-search-result strong {
  font-size: 0.92rem;
}

.global-search-result span,
.global-search-empty {
  font-size: 0.82rem;
  color: var(--muted);
}

.global-search-result:hover,
.global-search-result:focus {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, white);
}

.topbar-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.topbar-context-actions,
.topbar-context-cluster {
  gap: 8px;
}

.topbar-context-chip {
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.topbar-context-chip__label {
  color: rgba(231, 239, 248, 0.62);
}

.topbar-context-chip strong {
  color: #ffffff;
}

.user-menu-button,
.global-topbar .ghost-button,
.topbar-context-cluster .secondary-button--compact {
  min-height: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: none;
}

.user-menu-button:hover,
.global-topbar .ghost-button:hover,
.topbar-context-cluster .secondary-button--compact:hover {
  background: rgba(255, 255, 255, 0.12);
}

.user-menu-button__avatar {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.user-menu-dropdown {
  border-radius: 12px;
  border-color: var(--hubspot-border);
  background: var(--hubspot-surface);
}

.panel-section {
  display: none;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 18px 22px 22px;
  background: var(--hubspot-bg);
}

.panel-section.is-visible {
  display: block;
}

.stats-grid,
.panel-grid,
.workspace-panel,
.report-grid,
.report-split,
.template-builder__grid,
.agent-project-grid,
.panel-grid--overview-top,
.panel-grid--overview-main {
  width: 100%;
}

#agent.panel-section.is-visible {
  display: grid;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

#agentWorkspace {
  min-height: 0;
  height: 100%;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--hubspot-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading h3,
.entry-form h4,
.workspace-section__header h4,
.admin-title,
.detail-section-title,
.detail-title h4,
.overview-project-card h4,
.overview-insight-card h4,
.global-topbar h2,
.brand-title {
  margin: 0;
  color: var(--hubspot-text);
  font-family: "Manrope", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.workspace-copy,
.detail-caption,
.render-summary,
.section-heading p:not(.section-kicker) {
  color: var(--hubspot-muted);
}

input,
select,
textarea {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--hubspot-border);
  background: #ffffff;
  color: var(--hubspot-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

textarea {
  min-height: 92px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(45, 140, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(45, 140, 255, 0.14);
}

.primary-button,
.secondary-button,
.ghost-button,
.assign-toolbar button,
.assignment-actions button,
.contact-pool-footer .secondary-button,
.workspace-header__meta button {
  min-height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.primary-button {
  border: 1px solid var(--hubspot-blue-strong);
  background: linear-gradient(180deg, var(--hubspot-blue) 0%, var(--hubspot-blue-strong) 100%);
  color: #ffffff;
}

.primary-button:hover {
  background: linear-gradient(180deg, #1e84ff 0%, #0e6be0 100%);
}

.secondary-button,
.ghost-button,
.assign-toolbar button,
.workspace-header__meta button {
  border: 1px solid var(--hubspot-border);
  background: #ffffff;
  color: var(--hubspot-text);
}

.secondary-button:hover,
.ghost-button:hover,
.assign-toolbar button:hover,
.workspace-header__meta button:hover {
  background: #e7eff8;
  border-color: var(--hubspot-border-strong);
}

.badge,
.status-pill {
  border-radius: 999px;
  min-height: 24px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge {
  border: 1px solid var(--hubspot-border);
  background: #f7fafc;
  color: var(--hubspot-muted);
}

.status-pill {
  border: 1px solid color-mix(in srgb, var(--status-color, #2d8cff) 18%, var(--hubspot-border));
  background: color-mix(in srgb, var(--status-color, #2d8cff) 12%, #ffffff);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card,
.overview-stat-card,
.agent-launcher-stat {
  border-radius: 12px;
}

.stat-card,
.overview-stat-card {
  padding: 14px 16px;
}

.stat-card p,
.overview-stat-card p {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hubspot-muted);
}

.stat-card h3,
.overview-stat-card h3 {
  margin: 6px 0 2px;
  font-size: 1.5rem;
  line-height: 1;
}

.contact-pool-list,
.contact-pool-list--agent {
  min-height: 0;
}

.crm-table-shell {
  border-radius: 10px;
  overflow: auto;
}

.contact-pool-row {
  min-height: 42px;
  border-bottom: 1px solid rgba(223, 231, 239, 0.9);
  background: transparent;
}

.contact-pool-row:last-child {
  border-bottom: 0;
}

.contact-pool-row--header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 38px;
  padding-top: 0;
  background: #f8fbfd;
}

.contact-pool-cell,
.contact-pool-header-cell {
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 0.84rem;
}

.contact-pool-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-pool-header-cell {
  color: var(--hubspot-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.contact-pool-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e8f1fb;
  color: #214b76;
  font-size: 0.68rem;
  font-weight: 700;
}

.contact-pool-identity__text {
  font-weight: 600;
}

.contact-column-resizer {
  width: 10px;
  min-width: 10px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(223, 231, 239, 0) 0%, rgba(111, 149, 188, 0.28) 40%, rgba(111, 149, 188, 0.28) 60%, rgba(223, 231, 239, 0) 100%);
  opacity: 0.6;
}

.contact-column-resizer:hover {
  opacity: 1;
}

.contact-columns-option {
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
}

.checkbox-line,
.contact-columns-option {
  color: var(--hubspot-text);
}

.checkbox-line {
  gap: 8px;
  font-size: 0.86rem;
  line-height: 1.25;
}

.checkbox-line input[type="checkbox"],
.contact-columns-option input[type="checkbox"],
input[type="checkbox"].substituted {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin: 0;
  border-radius: 3px;
  border: 1px solid #90a4b7;
  background-color: #ffffff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0;
  box-shadow: 0 0 0 0.03em rgba(0, 0, 0, 0.08), 0 0.04em 0.12em -0.03em rgba(0, 0, 0, 0.14) inset;
  transition: border-color 120ms ease, background-color 120ms ease, background-size 120ms ease, box-shadow 120ms ease;
}

.checkbox-line input[type="checkbox"]:checked,
.contact-columns-option input[type="checkbox"]:checked,
input[type="checkbox"].substituted:checked {
  border-color: var(--hubspot-blue-strong);
  background-color: var(--hubspot-blue-strong);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' viewBox='0 0 9 9'%3E%3Crect fill='white' x='0' y='4.3' transform='matrix(-0.707 -0.7072 0.7072 -0.707 0.5891 10.4702)' width='4.3' height='1.6' /%3E%3Crect fill='white' x='2.2' y='2.9' transform='matrix(-0.7071 0.7071 -0.7071 -0.7071 12.1877 2.9833)' width='6.1' height='1.7' /%3E%3C/svg%3E");
  background-size: 8px;
  box-shadow: 0 0 0 0.03em rgba(18, 115, 234, 0.16), 0 0.04em 0.12em -0.03em rgba(18, 115, 234, 0.18) inset;
}

.checkbox-line input[type="checkbox"]:focus-visible,
.contact-columns-option input[type="checkbox"]:focus-visible,
input[type="checkbox"].substituted:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 140, 255, 0.22);
}

.checkbox-line input[type="checkbox"]:disabled,
.contact-columns-option input[type="checkbox"]:disabled,
input[type="checkbox"].substituted:disabled {
  opacity: 0.52;
}

.workspace-tabs {
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #edf3f8;
}

.workspace-tabs button,
.agent-detail-tab {
  min-height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--hubspot-muted);
  font-weight: 600;
}

.workspace-tabs button.is-active,
.agent-detail-tab.is-active {
  background: #ffffff;
  border-color: var(--hubspot-border);
  color: var(--hubspot-text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.panel-card--agent-detail {
  height: 100%;
  padding: 14px;
}

.agent-record-shell {
  min-height: calc(100vh - var(--shell-topbar-height) - 58px);
  display: grid;
  gap: 14px;
}

.detail-card--hero-compact {
  padding: 14px 16px;
}

.agent-record-layout {
  display: grid;
  grid-template-columns: minmax(290px, 1fr) minmax(500px, 1.45fr) minmax(310px, 0.92fr);
  gap: 14px;
  min-height: 0;
  align-items: stretch;
}

.agent-record-column {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.agent-record-column__header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--hubspot-border);
  background: #fbfdff;
}

.agent-record-column__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.agent-record-column__scroll--center {
  padding-top: 14px;
}

.agent-contact-summary {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--hubspot-border);
  background: #f8fbfd;
}

.agent-detail-stack {
  gap: 14px;
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  min-height: max-content;
}

.agent-detail-stack > * {
  width: 100%;
  align-self: start;
}

.agent-insight-card {
  border-radius: 12px;
  border: 1px solid var(--hubspot-border);
  background: #ffffff;
}

.detail-card--wrapup {
  border-color: rgba(45, 140, 255, 0.24);
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9fe 100%);
}

.detail-card--wrapup-sticky {
  position: sticky;
  top: 0;
  align-self: start;
}

.agent-wrapup-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(45, 140, 255, 0.14);
  background: linear-gradient(180deg, rgba(45, 140, 255, 0.06), rgba(45, 140, 255, 0));
}

.agent-wrapup-highlight {
  margin: 14px 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(45, 140, 255, 0.18);
  background: rgba(45, 140, 255, 0.05);
}

.detail-card--wrapup .assignment-fields-grid,
.detail-card--wrapup .assignment-actions,
.detail-card--wrapup .agent-wrapup-summary {
  padding-inline: 16px;
}

.detail-card--wrapup .dialing-embed-card {
  margin: 0 16px 16px;
}

.detail-card--wrapup .assignment-actions {
  padding-bottom: 16px;
}

.agent-list-shell {
  height: calc(100vh - var(--shell-topbar-height) - 166px);
  min-height: 0;
}

.agent-list-shell__main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}

.agent-record-shell--dense {
  gap: 12px;
}

.agent-record-hero {
  display: grid;
  gap: 12px;
}

.agent-record-hero__identity {
  display: grid;
  gap: 4px;
}

.agent-record-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-record-toolbar__group--hero {
  align-self: flex-start;
}

.agent-record-layout--dense {
  grid-template-columns: minmax(300px, 0.92fr) minmax(560px, 1.45fr) minmax(340px, 1fr);
  gap: 12px;
}

.agent-record-center-header {
  display: grid;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--hubspot-border);
  background: linear-gradient(180deg, #fcfdff 0%, #f8fbfe 100%);
}

.agent-record-fact-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 14px;
}

.agent-record-fact {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--hubspot-border);
  background: #f8fbfd;
}

.agent-record-fact span {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.agent-record-fact strong {
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--ink);
}

.agent-wrapup-highlight--priority {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, white), #ffffff 72%);
  border-color: color-mix(in srgb, var(--accent) 32%, var(--hubspot-border));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.agent-wrapup-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 2px;
}

.agent-wrapup-kpi {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(45, 140, 255, 0.05);
  border: 1px solid rgba(45, 140, 255, 0.16);
}

.agent-wrapup-kpi span {
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.agent-wrapup-kpi strong {
  font-size: 0.86rem;
  line-height: 1.3;
}

.assignment-actions--wrapup {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(247, 250, 255, 0.92) 24%);
}

.agent-record-shell--hubspot {
  gap: 0;
  height: 100%;
  overflow: hidden;
}

.agent-record-layout--hubspot {
  grid-template-columns: minmax(320px, 0.9fr) minmax(620px, 1.55fr) minmax(360px, 1fr);
  min-height: calc(100vh - var(--shell-topbar-height) - 92px);
  height: calc(100vh - var(--shell-topbar-height) - 92px);
  align-items: stretch;
}

.agent-record-shell--hubspot .agent-record-column,
.agent-record-shell--hubspot .agent-record-rail,
.agent-record-shell--hubspot .agent-record-center-pane {
  min-height: 0;
  height: 100%;
}

.agent-record-column--left,
.agent-record-rail--left {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.agent-record-shell--hubspot .agent-record-rail--left {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.agent-record-rail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.agent-record-rail__header {
  display: grid;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--hubspot-border);
  background: linear-gradient(180deg, #fcfdff 0%, #f7fbfe 100%);
}

.agent-record-breadcrumbbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-record-breadcrumbbar__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-record-breadcrumbbar__nav--split {
  width: 100%;
  justify-content: space-between;
}

.agent-record-breadcrumbbar__back,
.agent-record-breadcrumbbar__actions {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
}

.agent-record-breadcrumbbar__back::before {
  content: "‹";
  margin-right: 8px;
  font-size: 1.2em;
}

.agent-record-rail__scroll {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding: 10px 14px 26px;
}

.agent-record-shell--hubspot .agent-record-rail--left .agent-record-rail__scroll {
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  padding-bottom: 140px;
}

.agent-contact-summary--hubspot {
  border-radius: 18px;
  border-color: color-mix(in srgb, var(--accent) 18%, var(--hubspot-border));
  background: linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.agent-contact-summary--hubspot .agent-contact-summary__avatar {
  width: 56px;
  height: 56px;
  font-size: 1rem;
}

.agent-contact-summary--hubspot .agent-contact-summary__identity strong {
  font-size: 1.05rem;
}

.agent-contact-summary--hubspot .agent-contact-summary__identity span {
  font-size: 0.9rem;
}

.agent-contact-summary__email {
  display: inline-flex;
  margin-top: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.agent-contact-quick-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding-top: 4px;
}

.agent-contact-quick-action {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--hubspot-muted);
  border: 0;
  background: transparent;
  padding: 0;
}

.agent-contact-quick-action span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--hubspot-border);
  background: linear-gradient(180deg, #eff6fc 0%, #e7f1fb 100%);
  color: #587a9d;
  font-size: 0.88rem;
  font-weight: 700;
}

.agent-contact-quick-action small {
  font-size: 0.76rem;
  font-weight: 600;
  color: inherit;
}

.agent-rail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
}

.agent-rail-section-header h4 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--hubspot-ink);
}

.agent-record-fact-strip--stacked {
  grid-template-columns: 1fr;
}

.agent-record-workspace-tabshell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--hubspot-border);
  background: transparent;
}

.agent-record-workspace-tabshell__links,
.agent-record-workspace-tabshell__nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-record-workspace-tabshell__links {
  justify-content: flex-start;
}

.agent-record-workspace-tabshell__nav {
  justify-content: flex-end;
}

.agent-record-column__scroll--center {
  padding: 18px 20px 20px;
  background: #f7fafc;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.agent-record-customize-link {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
}

.agent-detail-tabs--hubspot {
  gap: 0;
  border: 1px solid var(--hubspot-border);
  border-radius: 0;
  overflow: hidden;
  background: #f8fbfd;
  flex: 1 1 auto;
}

.agent-detail-tabs--hubspot .agent-detail-tab {
  flex: 1 1 0;
  border: 0;
  border-right: 1px solid var(--hubspot-border);
  border-radius: 0;
  padding: 13px 16px;
  background: transparent;
  color: var(--hubspot-muted);
}

.agent-detail-tabs--hubspot .agent-detail-tab:last-child {
  border-right: 0;
}

.agent-detail-tabs--hubspot .agent-detail-tab.is-active {
  background: #ffffff;
  color: var(--hubspot-ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.agent-record-center-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.agent-record-layout-linkbar {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  align-items: center;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  position: fixed;
  right: 34px;
  bottom: 108px;
  z-index: 18;
  white-space: nowrap;
}

.agent-record-column__footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--hubspot-border);
  background: #ffffff;
  flex: none;
  position: relative;
  z-index: 2;
}

.agent-record-column__footer .floating-filter-link,
.agent-record-column__footer .agent-layout-link {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  margin: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.agent-workspace-project-content .agent-record-column__footer .floating-filter-link,
.agent-workspace-project-content .agent-record-column__footer .agent-layout-link {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  margin-left: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.contact-detail-grid__footerline {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 8px;
}

.contact-detail-grid--compact .contact-detail-grid__footerline {
  grid-column: 1 / -1;
}

.contact-detail-grid__footerline .floating-filter-link,
.contact-detail-grid__footerline .agent-layout-link,
.agent-workspace-project-content .contact-detail-grid__footerline .floating-filter-link,
.agent-workspace-project-content .contact-detail-grid__footerline .agent-layout-link {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
}

.agent-layout-link {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0;
  text-decoration: none;
}

.agent-record-layout-linkbar .floating-filter-link,
.agent-record-layout-linkbar .agent-layout-link {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--accent);
  padding: 0;
  min-height: 0;
  text-decoration: none;
}

.contact-history-list {
  display: grid;
  gap: 14px;
}

.agent-hubspot-card {
  display: grid;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--hubspot-border);
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(13, 36, 66, 0.02);
}

.agent-hubspot-card--top-aligned {
  align-content: start;
}

.agent-hubspot-card--highlights {
  max-height: 80px;
  overflow: hidden;
  align-content: center;
  padding-top: 12px;
  padding-bottom: 12px;
}

.agent-hubspot-activity-composer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--hubspot-border);
  background: #f9fbfd;
}

.agent-hubspot-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-hubspot-card__header h4 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--hubspot-ink);
}

.agent-hubspot-card__header--spread {
  justify-content: space-between;
}

.agent-hubspot-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.agent-hubspot-highlight {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.agent-hubspot-highlight span {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hubspot-muted);
}

.agent-hubspot-highlight strong {
  font-size: 1rem;
  font-weight: 500;
  color: var(--hubspot-ink);
}

.agent-hubspot-activity-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.agent-hubspot-search {
  flex: 1 1 260px;
  min-width: 220px;
}

.agent-hubspot-search input {
  width: 100%;
}

.agent-hubspot-filterchips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.agent-hubspot-filterchip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  background: #dff2fb;
  color: #0f7ca6;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.agent-history-list--previous-leads {
  align-content: start;
}

.agent-history-item--previous-lead {
  align-items: stretch;
}

.agent-history-item__main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.agent-history-item__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-history-item__side {
  display: flex;
  align-items: flex-start;
  flex: 0 0 auto;
}

.agent-new-contact-form {
  display: grid;
  gap: 14px;
  align-content: start;
}

.agent-hubspot-timeline {
  display: grid;
  gap: 12px;
}

.agent-hubspot-event {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.agent-hubspot-event__marker {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #9fb4c9;
  margin-top: 16px;
  position: relative;
}

.agent-hubspot-event__marker::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 1px;
  height: calc(100% + 16px);
  background: #d8e3ef;
  transform: translateX(-50%);
}

.agent-hubspot-event:last-child .agent-hubspot-event__marker::after {
  display: none;
}

.agent-hubspot-event--email .agent-hubspot-event__marker {
  background: #3bbfa6;
}

.agent-hubspot-event__card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--hubspot-border);
  background: #ffffff;
}

.agent-hubspot-event__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.agent-hubspot-event__header strong {
  color: var(--hubspot-ink);
}

.agent-hubspot-event__header span,
.agent-hubspot-event__card p {
  color: var(--hubspot-muted);
}

.agent-hubspot-event__body {
  color: var(--hubspot-ink);
  line-height: 1.6;
}

.contact-sequence-history {
  display: grid;
  gap: 16px;
}

.contact-sequence-card {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 255, 0.96));
  box-shadow: var(--shadow-soft);
}

.contact-sequence-card__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.contact-sequence-card__header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.contact-sequence-card__status--success {
  background: rgba(20, 145, 94, 0.12);
  color: #106f4f;
}

.contact-sequence-card__status--warning {
  background: rgba(198, 123, 0, 0.14);
  color: #9b6100;
}

.contact-sequence-card__status--danger {
  background: rgba(210, 63, 63, 0.12);
  color: #9f2a2a;
}

.contact-sequence-card__status--neutral {
  background: rgba(18, 115, 234, 0.1);
  color: #0f62d6;
}

.contact-sequence-card__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.contact-sequence-card__stats div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.contact-sequence-card__stats span {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.contact-sequence-card__stats strong {
  font-size: 0.95rem;
  line-height: 1.35;
}

.contact-sequence-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.contact-sequence-step {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.contact-sequence-step.is-current {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, white);
}

.contact-sequence-step span,
.contact-sequence-step small {
  color: var(--muted);
}

.contact-sequence-list {
  display: grid;
  gap: 12px;
}

.contact-sequence-entry {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.contact-sequence-entry--success {
  border-color: rgba(20, 145, 94, 0.24);
  background: rgba(20, 145, 94, 0.05);
}

.contact-sequence-entry--warning {
  border-color: rgba(198, 123, 0, 0.28);
  background: rgba(198, 123, 0, 0.06);
}

.contact-sequence-entry--danger {
  border-color: rgba(210, 63, 63, 0.26);
  background: rgba(210, 63, 63, 0.05);
}

.contact-sequence-entry__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.contact-sequence-entry__header p,
.contact-sequence-entry__subject,
.contact-sequence-entry__error {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.contact-sequence-entry__subject {
  color: var(--muted);
}

.contact-sequence-entry__error {
  color: #9f2a2a;
}

.contact-sequence-entry__status {
  white-space: nowrap;
}

.contact-history-item {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
  box-shadow: var(--shadow-soft);
}

.contact-history-item__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.contact-history-item__header p,
.contact-history-item__copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.contact-history-change-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.contact-history-change {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.contact-history-change span {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-history-change strong {
  font-size: 0.95rem;
  line-height: 1.45;
  word-break: break-word;
}

@media (max-width: 900px) {
  .contact-history-change-grid {
    grid-template-columns: 1fr;
  }

  .contact-sequence-card__stats {
    grid-template-columns: 1fr 1fr;
  }

  .agent-record-layout-linkbar {
    gap: 10px;
    padding-bottom: 14px;
  }
}

.agent-side-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--hubspot-border);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
}

.agent-side-card--project-questions {
  gap: 14px;
  padding: 16px;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.agent-side-card--context-nav {
  gap: 10px;
  padding: 12px;
  border: 0;
  background: linear-gradient(180deg, #192533 0%, #121c28 100%);
  box-shadow: 0 12px 28px rgba(8, 15, 26, 0.22);
}

.topbar-context-actions--agent-detail {
  justify-content: flex-start;
}

.topbar-context-chip--agent-detail {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.topbar-context-cluster--agent-detail {
  width: 100%;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

.agent-context-button {
  min-height: 38px;
  border: 1px solid #d8e3ef;
  color: #35526d !important;
  background: #ffffff;
  box-shadow: none;
}

.agent-context-button:hover,
.agent-context-button:focus-visible {
  color: #163a59 !important;
  background: #f7fafc;
}

.agent-context-button--project {
  background: #ff7a59;
  border-color: #ff7a59;
  color: #ffffff !important;
  margin-right: 2px;
}

.agent-context-button--project:hover,
.agent-context-button--project:focus-visible {
  background: #f36d4c;
  border-color: #f36d4c;
  color: #ffffff !important;
}

.agent-context-button--list {
  background: #eef5fc;
  border-color: #cfe0ef;
  color: #1a5277 !important;
  margin-right: auto;
}

.agent-context-button--list:hover,
.agent-context-button--list:focus-visible {
  background: #e1edf8;
  color: #163a59 !important;
}

.agent-context-button--nav {
  background: #ffffff;
}

.agent-context-button--nav:hover,
.agent-context-button--nav:focus-visible {
  background: #f7fafc;
}

.agent-record-rightpane {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.agent-record-rightpane__scroll {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
  padding-bottom: 116px;
}

.agent-record-rightpane__footer {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 19;
  width: 360px;
  padding: 0 0 2px;
  background: transparent;
  pointer-events: none;
}

.agent-record-rail--right {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.agent-association-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--hubspot-border);
  border-radius: 0;
  background: #ffffff;
}

.agent-association-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-association-card__header h4 {
  margin: 0;
  font-size: 0.98rem;
  color: var(--hubspot-ink);
}

.agent-association-card__add {
  color: var(--accent);
  font-weight: 700;
}

.agent-association-company {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--hubspot-border);
  background: #ffffff;
}

.agent-association-company__identity {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.agent-association-company__avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #edf4fb;
  color: #7f97ae;
  font-weight: 700;
}

.agent-association-company__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.agent-association-company__meta {
  display: grid;
  gap: 8px;
  color: var(--hubspot-muted);
  font-size: 0.9rem;
}

.agent-association-summary {
  display: grid;
  gap: 12px;
}

.agent-association-summary div {
  display: grid;
  gap: 4px;
}

.agent-association-summary span {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hubspot-muted);
}

.agent-association-card__actions {
  display: flex;
  justify-content: flex-start;
}

.workspace-empty--compact {
  min-height: 0;
  padding: 24px 12px;
  border-radius: 10px;
}

.agent-wrapup-pane--hubspot {
  align-self: stretch;
}

.agent-record-rail--right .project-builder-field--half,
.agent-record-rail--right .project-ui-block--half {
  grid-column: span 12;
}

.agent-wrapup-pane {
  position: static;
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
  align-self: start;
}

.agent-wrapup-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin: -2px 0 4px;
}

.agent-wrapup-tab {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--hubspot-muted);
  font-weight: 700;
}

.agent-wrapup-tab__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e7f1fb;
  color: #315678;
  font-size: 0.72rem;
  font-weight: 700;
}

.agent-wrapup-tab.is-active {
  color: var(--ink);
  border-bottom-color: #0fbfb6;
}

.agent-wrapup-panel {
  display: grid;
  gap: 14px;
}

.agent-wrapup-panel__block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.agent-wrapup-panel__block--questions {
  background: linear-gradient(180deg, #f9fcff 0%, #ffffff 100%);
}

.agent-wrapup-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.agent-wrapup-shortcut {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 56px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--hubspot-border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.agent-wrapup-shortcut:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--hubspot-border));
  background: linear-gradient(180deg, #ffffff 0%, #eef8ff 100%);
}

.assignment-actions--wrapup-fixed {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  padding: 14px 16px 16px;
  border: 1px solid var(--hubspot-border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  pointer-events: auto;
}

.assignment-actions--wrapup-fixed .primary-button,
.assignment-actions--wrapup-fixed .secondary-button,
.assignment-actions--wrapup-fixed .ghost-button {
  flex: 1 1 0;
  min-width: 0;
}

.agent-company-location-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--hubspot-border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.agent-company-location-card__picker {
  display: grid;
  gap: 6px;
}

.agent-company-location-card__picker span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--hubspot-muted);
}

.agent-company-location-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--hubspot-border);
  border-radius: 12px;
  background: #ffffff;
}

.agent-company-location-preview__header,
.agent-company-location-preview__badges,
.agent-company-location-preview__meta,
.agent-company-location-preview__address {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-company-location-preview__meta,
.agent-company-location-preview__address {
  color: var(--hubspot-muted);
  font-size: 0.84rem;
}

.agent-wrapup-panel__title {
  display: grid;
  gap: 4px;
}

.agent-wrapup-panel__title strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.agent-wrapup-panel__title span {
  color: var(--muted);
  font-size: 0.8rem;
}

.assignment-fields-grid--wrapup {
  gap: 12px;
}

.assignment-field--response {
  display: grid;
  gap: 6px;
}

.assignment-field--response > span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

.agent-response-picker .filter-combobox__option {
  display: grid;
  gap: 3px;
  text-align: left;
}

.agent-response-picker .filter-combobox__option strong {
  font-size: 0.9rem;
  color: var(--ink);
}

.agent-response-picker .filter-combobox__option span {
  font-size: 0.75rem;
  color: var(--muted);
}

.agent-response-picker__rowhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.agent-response-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.agent-response-badge--neutral {
  background: #edf3f9;
  color: #46627e;
  border: 1px solid #d7e4f0;
}

.agent-response-badge--user {
  background: #eef7ff;
  color: #1760a6;
  border: 1px solid #cfe4fa;
}

.agent-response-badge--system {
  background: #f2f0ff;
  color: #5c46b3;
  border: 1px solid #ddd6ff;
}

.agent-response-badge--positive {
  background: #eaf8ef;
  color: #167244;
  border: 1px solid #ccebd8;
}

.agent-response-badge--danger {
  background: #fff1f2;
  color: #b44757;
  border: 1px solid #f2d1d7;
}

.agent-wrapup-preview {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.agent-wrapup-preview--empty {
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.agent-wrapup-preview__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.agent-wrapup-preview__header strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.agent-wrapup-effects {
  display: grid;
  gap: 8px;
}

.agent-wrapup-effect {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.agent-wrapup-effect > span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 78%, white);
}

.agent-wrapup-effect p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.assignment-field--notes {
  grid-column: 1 / -1;
}

.assignment-field--notes textarea {
  min-height: 140px;
}

.assignment-field--notes textarea,
.agent-wrapup-pane textarea[name="notes"] {
  min-height: 48px;
  max-height: 96px;
  overflow-y: auto;
  resize: vertical;
}

.project-additional-creator {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fd 100%);
  margin-bottom: 14px;
}

.project-additional-editor-list {
  display: grid;
  gap: 12px;
}

.project-additional-editor-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.project-additional-editor-card__summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  background: linear-gradient(180deg, #fbfdff 0%, #f7fafd 100%);
}

.project-additional-editor-card__summary::-webkit-details-marker {
  display: none;
}

.project-additional-editor-card__summary strong {
  display: block;
  color: var(--ink);
}

.project-additional-editor-card__summary p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.project-additional-editor-card[open] .project-additional-editor-card__summary {
  border-bottom: 1px solid var(--line);
}

.field-admin-row--stacked {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.field-required-indicator {
  display: inline-flex;
  margin-left: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

[data-project-additional-field].is-invalid {
  border-color: #c84d57;
  box-shadow: 0 0 0 1px rgba(200, 77, 87, 0.18);
  background: rgba(200, 77, 87, 0.05);
}

[data-project-additional-field].is-invalid input,
[data-project-additional-field].is-invalid select,
[data-project-additional-field].is-invalid textarea {
  border-color: #c84d57;
  box-shadow: 0 0 0 3px rgba(200, 77, 87, 0.12);
}

.agent-overview-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-grid--contact-overview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.contact-detail-grid--compact {
  gap: 8px;
}

.agent-record-rail--left .contact-detail-grid--compact {
  padding-top: 2px;
  padding-bottom: 50px;
}

.agent-hubspot-timeline {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.agent-field-input--readonly .agent-field-input__readonly {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #d8e4ef;
  border-radius: 10px;
  background: #f8fbfd;
  color: var(--ink);
  font-size: 0.86rem;
}

.agent-record-contact-id-fixed {
  position: fixed;
  left: 24px;
  bottom: 18px;
  z-index: 18;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--hubspot-muted);
  background: rgba(255, 255, 255, 0.94);
  padding: 6px 10px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.contact-detail-grid--compact label {
  gap: 4px;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hubspot-muted);
}

.contact-detail-grid--compact input,
.contact-detail-grid--compact select,
.contact-detail-grid--compact textarea {
  padding: 8px 10px;
  font-size: 0.86rem;
}

.contact-detail-grid--compact textarea {
  min-height: 88px;
}

.agent-field-input {
  position: relative;
  display: grid;
  gap: 6px;
}

.agent-field-input__action {
  margin-left: auto;
}

.agent-field-input__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.agent-field-input__row .ghost-button--tight {
  min-height: 38px;
  padding: 0 12px;
  white-space: nowrap;
}

.agent-field-input > span:first-child,
.agent-field-input__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ghost-button--tight {
  padding: 2px 8px;
  min-height: 0;
  font-size: 0.76rem;
}

.template-merge-picker,
.template-preview-contact {
  display: inline-grid;
  gap: 0.3rem;
  min-width: 220px;
  font-size: 0.78rem;
  color: var(--muted);
}

.template-merge-picker span,
.template-merge-token-preview span,
.template-preview-contact span {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.template-merge-picker input,
.template-preview-contact select {
  min-height: 36px;
}

.template-merge-token-preview {
  display: inline-grid;
  gap: 0.3rem;
  min-width: 240px;
  font-size: 0.78rem;
  color: var(--muted);
}

.template-merge-token-preview code {
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-toolbar {
  align-items: end;
}

.email-verify-embed {
  min-height: 68vh;
  height: 68vh;
  border: 1px solid var(--hubspot-border);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}

.agent-record-rail--left .agent-side-card,
.agent-record-rail--right .agent-side-card {
  gap: 12px;
  padding: 14px;
}

.agent-list-table-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.contact-pool-list--agent {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1 1 auto;
  overflow: hidden;
  gap: 10px;
  padding-bottom: 0;
}

.contact-list-shell .agent-list-table-shell {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.contact-list-shell .contact-pool-table-wrap {
  min-height: 0;
  overflow: auto;
  height: 100%;
  max-height: 100%;
  overscroll-behavior: contain;
}

.contact-list-shell .contact-pool-table {
  min-height: 0;
  width: max-content;
  min-width: 100%;
}

.contact-list-shell .agent-list-shell__main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  max-height: 100%;
}

.contact-list-shell .contact-pool-list--agent {
  display: block;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.company-directory-footer-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
}

.agent-filter-drawer {
  padding: 16px;
  border-left: 1px solid var(--hubspot-border);
}

.filter-box--agent-drawer {
  gap: 14px;
}

.filter-row-card {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  padding: 14px;
}

.floating-filter-actions {
  right: 22px;
  bottom: 12px;
}

.floating-filter-link {
  font-size: 0.82rem;
  color: var(--hubspot-muted);
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: var(--shell-sidebar-collapsed-width) minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  width: var(--shell-sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-top {
  padding-inline: 8px;
}

body.sidebar-collapsed .sidebar-bottom {
  padding-inline: 8px;
}

body.sidebar-collapsed .sidebar,
body.sidebar-collapsed .sidebar-nav-shell {
  overflow-x: visible;
}

body.sidebar-collapsed .nav-chip {
  min-height: 38px;
}

.sidebar-hover-tooltip {
  position: fixed;
  transform: translateY(-50%);
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(18, 27, 40, 0.96);
  color: #f8fbff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 28px rgba(10, 16, 26, 0.34);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  z-index: 4000;
  pointer-events: none;
}

.sidebar-hover-tooltip.is-hidden {
  display: none;
}

body.sidebar-collapsed .nav-chip,
body.sidebar-collapsed .nav-subchip {
  position: relative;
  overflow: visible;
}

body.sidebar-collapsed .nav-chip[data-hover-label]:hover::after,
body.sidebar-collapsed .nav-subchip[data-hover-label]:hover::after,
body.sidebar-collapsed .nav-chip[data-hover-label]:hover::before,
body.sidebar-collapsed .nav-subchip[data-hover-label]:hover::before {
  content: none;
}

@media (max-width: 1380px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .agent-record-layout {
    grid-template-columns: minmax(260px, 0.95fr) minmax(420px, 1.25fr) minmax(280px, 0.86fr);
  }

  .agent-record-layout--hubspot {
    grid-template-columns: minmax(280px, 0.92fr) minmax(440px, 1.35fr) minmax(300px, 0.95fr);
  }
}

@media (max-width: 1120px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
  }

  .main-panel {
    min-height: auto;
    max-height: none;
    height: auto;
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .panel-section {
    height: auto;
    overflow: visible;
  }

  .agent-record-layout,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* UI cleanup follow-up */
.global-topbar,
body.crm-theme-dark .global-topbar {
  background: linear-gradient(180deg, #213a5a 0%, #1f3654 100%) !important;
}

.sidebar-toggle-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
}

.panel-grid--overview-top,
.panel-grid--overview-main {
  grid-template-columns: minmax(0, 1fr);
}

#sidebarSnapshot,
#serverInfoList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

#serverInfoList {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hubspot-border);
}

.checkbox-line input[type="checkbox"],
.contact-columns-option input[type="checkbox"],
input[type="checkbox"].substituted {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px;
  min-height: 15px;
  border-radius: 4px !important;
  background-image: none !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 0 !important;
  box-shadow: 0 0 0 0.03em rgba(0, 0, 0, 0.06), 0 0.04em 0.12em -0.03em rgba(0, 0, 0, 0.12) inset !important;
}

.checkbox-line input[type="checkbox"]::after,
.contact-columns-option input[type="checkbox"]::after,
input[type="checkbox"].substituted::after {
  content: none !important;
  display: none !important;
}

.checkbox-line input[type="checkbox"]:checked,
.contact-columns-option input[type="checkbox"]:checked,
input[type="checkbox"].substituted:checked {
  border-color: var(--hubspot-blue-strong) !important;
  background-color: var(--hubspot-blue-strong) !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' viewBox='0 0 9 9'%3E%3Crect fill='white' x='0' y='4.3' transform='matrix(-0.707 -0.7072 0.7072 -0.707 0.5891 10.4702)' width='4.3' height='1.6' /%3E%3Crect fill='white' x='2.2' y='2.9' transform='matrix(-0.7071 0.7071 -0.7071 -0.7071 12.1877 2.9833)' width='6.1' height='1.7' /%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 9px 9px !important;
}

.contact-columns-option {
  gap: 10px;
  align-items: center;
}

.contact-columns-option span,
.checkbox-line span,
.checkbox-line label {
  line-height: 1.3;
}

.checkbox-line--stacked {
  align-items: flex-start;
  line-height: 1.35;
}

.checkbox-line--tile {
  align-items: flex-start;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: auto 1fr;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(111, 145, 191, 0.22);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(18, 35, 61, 0.04);
}

.checkbox-line--tile span {
  display: grid;
  gap: 0.22rem;
}

.checkbox-line--tile small {
  color: var(--hubspot-muted);
  line-height: 1.35;
}

.permission-picker {
  display: grid;
  gap: 1rem;
}

.permission-picker--inline {
  margin-top: 0.9rem;
}

.permission-group {
  display: grid;
  gap: 0.7rem;
}

.permission-group__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}

.danger-text-button {
  color: #cb3f4f;
}

.field-admin-actions--sticky {
  margin-top: 1rem;
  justify-content: flex-end;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(111, 145, 191, 0.16);
}

.field-admin-row--field {
  display: grid;
  gap: 1rem;
  padding: 1.1rem 1.15rem;
}

.field-admin-row__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.field-admin-row__header-main {
  flex: 1 1 auto;
  min-width: 0;
}

.field-admin-row__header-button {
  flex: 1 1 auto;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.field-admin-row__toggle {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.field-admin-row__header h4 {
  margin: 0.18rem 0 0.1rem;
  font-size: 1.05rem;
}

.field-admin-row__subtitle {
  margin: 0;
  color: var(--hubspot-muted);
  font-size: 0.84rem;
}

.field-admin-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.3rem;
}

.field-admin-actions--header {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.field-admin-inline-edit {
  white-space: nowrap;
}

.field-admin-order-controls {
  display: inline-flex;
  gap: 6px;
}

.field-admin-position-label {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.field-admin-grid__full {
  grid-column: 1 / -1;
}

.panel-card--full-span {
  grid-column: 1 / -1;
}

.field-admin-row__body {
  display: none;
  gap: 1rem;
}

.field-admin-row--field.is-expanded .field-admin-row__body {
  display: grid;
}

#userManagementList .queue-row {
  width: 100%;
}

.user-access-stats {
  margin-bottom: 1.25rem;
}

.user-directory-card {
  display: grid;
  gap: 1rem;
}

.user-directory-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 2.2fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 0.9rem;
  align-items: end;
}

.user-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.queue-row--user {
  padding: 1.1rem 1.1rem;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(18, 35, 61, 0.05);
  min-height: 136px;
  justify-content: space-between;
  align-items: stretch;
  text-align: left;
}

.queue-row--user strong {
  font-size: 1.02rem;
}

.queue-row__meta--user {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.queue-row__meta--summary {
  align-items: flex-start;
  gap: 0.7rem;
}

.queue-row__avatar,
.user-editor-avatar {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 18px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(41, 121, 255, 0.16), rgba(12, 187, 223, 0.18));
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  box-shadow: inset 0 0 0 1px rgba(111, 145, 191, 0.16);
}

.queue-row__avatar img,
.user-editor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue-row__user-copy {
  display: grid;
  gap: 0.42rem;
}

.queue-row__facts,
.queue-row__feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.badge--soft {
  background: rgba(17, 102, 255, 0.08);
  color: var(--accent);
}

.badge--system-field {
  background: rgba(16, 120, 92, 0.12);
  border: 1px solid rgba(16, 120, 92, 0.2);
  color: #136f57;
}

.badge--custom-field {
  background: rgba(17, 102, 255, 0.08);
  border: 1px solid rgba(17, 102, 255, 0.16);
  color: var(--accent);
}

.badge--inactive {
  background: rgba(203, 63, 79, 0.12);
  color: #b83949;
}

.user-editor-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.9fr);
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(111, 145, 191, 0.16);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(244, 248, 252, 0.9));
}

.user-editor-hero__identity,
.user-editor-hero__upload {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.user-editor-avatar {
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: 22px;
  font-size: 1.1rem;
}

.user-editor-hero__identity {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.user-editor-hero__status {
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--hubspot-text);
}

.user-editor-modal__header {
  align-items: flex-start;
}

.user-editor-close-button {
  border-radius: 999px;
  font-size: 1.35rem;
  line-height: 1;
  background: color-mix(in srgb, var(--panel) 90%, white);
  border: 1px solid color-mix(in srgb, var(--hubspot-border-strong) 70%, var(--line));
}

.user-editor-close-button:hover {
  background: color-mix(in srgb, var(--accent) 12%, white);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  color: var(--accent);
}

.user-editor-flags-card {
  display: grid;
  gap: 0.85rem;
}

.user-editor-flags {
  margin-top: 0;
}

.user-editor-actions {
  justify-content: flex-end;
  align-items: center;
}

.user-editor-action {
  min-width: 132px;
  justify-content: center;
}

.user-editor-action--invite {
  background: linear-gradient(180deg, #eff5ff 0%, #dce9ff 100%);
  border-color: rgba(69, 116, 217, 0.3);
  color: #214f9b;
}

.user-editor-action--save {
  background: linear-gradient(180deg, #1fa766 0%, #118553 100%);
  border-color: rgba(14, 122, 76, 0.56);
  color: #ffffff;
}

.user-editor-action--delete {
  background: linear-gradient(180deg, #fff0f1 0%, #ffd9de 100%);
  border-color: rgba(200, 77, 87, 0.28);
  color: #b63f52;
}

.access-manager-toolbar {
  display: flex;
  justify-content: flex-end;
}

.role-manager-list {
  display: grid;
  gap: 0.8rem;
}

.role-manager-row {
  width: 100%;
  text-align: left;
  background: var(--panel);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.role-manager-row.is-active {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--hubspot-line));
  box-shadow: 0 16px 34px rgba(18, 35, 61, 0.08);
  transform: translateY(-1px);
}

.role-manager-row__summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.role-manager-row__summary p {
  margin: 0.25rem 0 0;
  color: var(--hubspot-muted);
}

.role-manager-row__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.role-manager-editor {
  display: grid;
  gap: 1rem;
}

.field-help-text {
  display: block;
  margin-top: 4px;
  color: var(--hubspot-muted);
  font-size: 0.76rem;
}

.project-builder-sections {
  display: grid;
  gap: 1rem;
}

.project-builder-section {
  border: 1px solid var(--hubspot-line);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.72);
}

.project-builder-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.85rem;
}

.project-builder-field {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  grid-column: span 12;
}

.project-builder-field--half,
.project-ui-block--half {
  grid-column: span 6;
}

.project-builder-field--full,
.project-ui-block--full {
  grid-column: span 12;
}

.project-ui-block {
  grid-column: span 12;
  border-radius: 16px;
  padding: 0.95rem 1rem;
  border: 1px solid var(--hubspot-line);
  background: rgba(17, 102, 255, 0.05);
}

.project-ui-block h5 {
  margin: 0.15rem 0 0.45rem;
  font-size: 0.98rem;
}

.project-ui-block p:last-child {
  margin: 0;
  color: var(--hubspot-muted);
  line-height: 1.5;
}

.project-ui-block--warning {
  border-color: rgba(241, 118, 56, 0.28);
  background: rgba(241, 118, 56, 0.08);
}

.project-ui-block--info {
  border-color: rgba(41, 121, 255, 0.22);
}

.panel-card--subtle {
  background: color-mix(in srgb, var(--panel) 82%, var(--page));
  box-shadow: none;
}

.report-column-group {
  border-top: 1px solid var(--hubspot-line);
  padding-top: 0.9rem;
}

.report-column-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.field-pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
  max-height: min(44vh, 420px);
  overflow: auto;
  padding-right: 0.35rem;
}

.field-pill-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--hubspot-line);
  border-radius: 14px;
  background: var(--panel);
  min-height: 44px;
}

.field-pill-option input[type="checkbox"] {
  margin: 0;
  width: 15px;
  height: 15px;
  min-width: 15px;
  min-height: 15px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--hubspot-line));
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 0 0 0.03em rgba(0, 0, 0, 0.06), 0 0.04em 0.12em -0.03em rgba(0, 0, 0, 0.12) inset;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0;
  transition: border-color 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease, background-size 0.14s ease;
}

.field-pill-option input[type="checkbox"]:checked {
  border-color: var(--hubspot-blue-strong);
  background-color: var(--hubspot-blue-strong);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.1' viewBox='0 0 9 9'%3E%3Crect fill='white' x='0' y='4.3' transform='matrix(-0.707 -0.7072 0.7072 -0.707 0.5891 10.4702)' width='4.3' height='1.6' /%3E%3Crect fill='white' x='2.2' y='2.9' transform='matrix(-0.7071 0.7071 -0.7071 -0.7071 12.1877 2.9833)' width='6.1' height='1.7' /%3E%3C/svg%3E");
  background-size: 9px 9px;
}

.field-pill-option input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(65, 159, 255, 0.22);
}

.field-pill-option span {
  color: var(--text-color);
  font-size: 0.92rem;
  line-height: 1.35;
}

.modal-card--wide {
  width: min(1080px, calc(100vw - 40px));
}

#reportBuilderModal .modal-card {
  width: min(1080px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
}

#reportPreviewModal .modal-card {
  width: min(1500px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  overflow: auto;
}

#reportPreviewModal #reportPreviewModalWorkspace,
#reportPreviewModal .panel-card,
#reportPreviewModal .report-table-wrap--preview {
  min-width: 0;
}

#reportPreviewModal .panel-card {
  overflow: visible;
}

#reportPreviewModal .report-table-wrap--preview {
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: auto;
}

#reportPreviewModal .report-table {
  width: max-content;
  min-width: 100%;
}

#reportPreviewModal .report-table th,
#reportPreviewModal .report-table td {
  white-space: nowrap;
}

#reportBuilderModal .modal-card,
#userEditorModal .modal-card,
#accessManagerModal .modal-card {
  max-height: 92vh;
  overflow: auto;
  overflow-x: hidden;
}

.report-builder-modal-shell {
  display: grid;
  gap: 1rem;
  min-height: min(80vh, 900px);
  max-height: 86vh;
  overflow: visible;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-x: visible;
}

.report-builder-modal-shell--hubspot {
  gap: 1.1rem;
  padding: 0;
}

.report-builder-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0 0.2rem;
}

.report-builder-topbar__title {
  display: grid;
  gap: 0.2rem;
}

.report-builder-topbar__title h4 {
  font-size: 2rem;
  line-height: 1.05;
}

.report-builder-topbar__close {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.7rem;
  line-height: 1;
  border-radius: 12px;
}

.report-builder-modal-shell > * {
  min-width: 0;
  box-sizing: border-box;
}

.field-create-modal__card {
  width: min(820px, calc(100vw - 32px));
}

.field-create-modal-shell {
  min-height: 0;
  max-height: min(78vh, 760px);
  gap: 0.85rem;
  padding: 0;
}

.field-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-create-grid__options {
  grid-column: 1 / -1;
}

@media (max-width: 1180px) {
  .field-library-table__header,
  .field-library-row {
    grid-template-columns: minmax(220px, 2fr) minmax(100px, 0.9fr) minmax(100px, 0.9fr) minmax(120px, 0.95fr) minmax(84px, 0.75fr) 64px minmax(124px, 0.95fr);
    gap: 12px;
  }
}

@media (max-width: 900px) {
  .user-directory-toolbar,
  .user-editor-hero,
  .field-create-grid {
    grid-template-columns: 1fr;
  }

  .field-library-table__header {
    display: none;
  }

  .field-library-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .field-library-row__actions {
    justify-content: flex-start;
  }
}

.report-builder-steps {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.report-builder-steps--hubspot {
  gap: 0;
  padding: 0;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  overflow: hidden;
  background: #f7fbff;
}

.report-builder-step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--hubspot-line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--hubspot-muted);
}

.report-builder-steps--hubspot .report-builder-step {
  flex: 1 1 0;
  justify-content: center;
  border: 0;
  border-right: 1px solid #d8e3ef;
  border-radius: 0;
  background: transparent;
  min-height: 58px;
}

.report-builder-steps--hubspot .report-builder-step:last-child {
  border-right: 0;
}

.report-builder-step.is-active {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--hubspot-line));
  color: var(--text-color);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}

.report-builder-steps--hubspot .report-builder-step.is-active {
  background: #ffffff;
  box-shadow: inset 0 -3px 0 #0fbfb6;
}

.report-builder-step__number {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.report-column-sortable {
  display: grid;
  gap: 0.7rem;
  max-height: min(40vh, 420px);
  overflow: auto;
  overflow-x: hidden;
  padding-top: 0.2rem;
  padding-right: 0.1rem;
  padding-bottom: 0.2rem;
  align-content: start;
}

.report-column-sortable__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--hubspot-line);
  border-radius: 6px;
  background: #eef4fb;
  cursor: grab;
  min-height: 0;
  box-sizing: border-box;
}

.report-column-sortable__header {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--hubspot-line);
  border-radius: 6px;
  background: #eef4fb;
  color: var(--hubspot-muted);
  font-size: 0.9rem;
}

.report-column-sortable__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.report-column-sortable__item.is-dragging {
  opacity: 0.5;
}

.report-column-sortable__meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.report-column-sortable__titleline {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
  flex-wrap: wrap;
}

.report-column-sortable__titleline > strong,
.report-column-sortable__titleline > .field-help-text {
  min-width: 0;
}

.report-column-sortable__meta strong {
  font-size: 0.9rem;
  line-height: 1.2;
  font-weight: 500;
}

.report-column-sortable__titleline .field-help-text {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--hubspot-muted);
}

.report-column-drag {
  color: #6b8ab2;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 0.78rem;
  min-width: 14px;
}

.report-builder-columns-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
  align-items: start;
}

.report-builder-columns-layout__picker,
.report-builder-columns-layout__selected {
  display: grid;
  gap: 12px;
  min-height: 0;
  min-width: 0;
  max-height: min(52vh, 520px);
  overflow: auto;
  overflow-x: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  align-content: start;
  box-sizing: border-box;
}

.report-builder-columns-layout__picker {
  padding-right: 12px;
  border-right: 1px solid var(--hubspot-line);
}

.report-builder-column-picker {
  width: 100%;
}

.report-builder-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
}

.report-builder-pane-header--hubspot {
  padding-bottom: 0.15rem;
}

.report-builder-pane-header strong {
  color: var(--heading-color);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.report-builder-pane-header--compact {
  margin-bottom: -2px;
}

.report-builder-column-checklist {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.25rem 0 0;
}

.report-column-group {
  display: grid;
  gap: 0.5rem;
  padding-top: 0;
  border-top: 0;
}

.report-column-group__title {
  color: var(--heading-color);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.report-column-checklist {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.12rem;
  max-height: none;
  overflow: visible;
  padding-right: 0.1rem;
  align-content: start;
}

.report-column-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.82rem;
  min-height: 32px;
}

.report-column-check:hover {
  background: rgba(13, 110, 253, 0.03);
}

.report-column-check span {
  line-height: 1.3;
  color: var(--heading-color);
}

.report-column-check input[type="checkbox"] {
  margin: 0;
  width: 18px;
  height: 18px;
}

.report-column-sortable__item .ghost-button {
  padding: 0.28rem 0.48rem;
  font-size: 0.74rem;
}

.report-builder-preview-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  overflow-x: visible;
}

.report-builder-card {
  padding: 1.4rem;
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(20, 48, 79, 0.04);
}

.report-builder-card--hero {
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.project-builder-grid--report-builder {
  gap: 14px;
}

.report-builder-field {
  gap: 7px;
}

.report-builder-type-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-builder-type-card {
  display: grid;
  gap: 6px;
  min-height: 110px;
  padding: 1rem;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #f8fbfe;
  text-align: left;
  color: #35526d;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.report-builder-type-card strong {
  color: #173a59;
  font-size: 1rem;
}

.report-builder-type-card small {
  color: #5f7891;
  line-height: 1.45;
}

.report-builder-type-card.is-active {
  border-color: #0fbfb6;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(15, 191, 182, 0.22);
}

.report-builder-section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-builder-filter-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.7fr) minmax(0, 1fr);
  gap: 14px;
  align-items: end;
  padding: 1rem;
  border-radius: 14px;
  background: #fbfdff;
  overflow: visible;
}

.report-builder-filter-card__header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-builder-filter-card__badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eaf3fb;
  color: #305273;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.report-builder-filter-card__remove {
  min-height: 34px;
  padding: 0 12px;
}

.report-builder-filter-card .filter-control {
  min-width: 0;
}

.report-builder-filter-card .filter-control input,
.report-builder-filter-card .filter-control select {
  min-height: 44px;
}

.report-builder-filter-card__field {
  grid-column: span 2;
}

.report-builder-filter-card__value {
  grid-column: 1 / -1;
}

.report-builder-actions--sticky {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 0.2rem;
  padding: 1rem 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #ffffff 24%);
}

.panel-card--report-library {
  width: 100%;
}

.list-card--report {
  width: 100%;
  padding: 1rem 1.1rem;
}

.list-card--report .assignment-actions--spread {
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.list-card--report .assignment-actions--inline {
  margin-left: auto;
  justify-content: flex-end;
}

#reportBuilderFilterWorkspace,
#reportSelectedColumns {
  min-height: 0;
}

#addReportFilterRule {
  margin-top: 0.35rem;
}

.report-column-sortable__item .ghost-button {
  min-width: 0;
}

.report-column-remove {
  padding: 0;
  border: 0;
  background: transparent;
  color: #7b93b3;
  font-size: 1.3rem;
  line-height: 1;
}

.report-column-remove:hover {
  color: var(--accent);
  background: transparent;
}

.report-table-wrap--preview {
  max-height: 62vh;
  overflow: auto;
}

.report-builder-flag {
  align-items: start;
}

@media (max-width: 1120px) {
  .report-builder-columns-layout,
  .report-builder-type-toggle,
  .project-builder-grid--report-builder {
    grid-template-columns: 1fr;
  }

  .report-builder-filter-card {
    grid-template-columns: 1fr;
  }
}

.reporting-library-dataset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.query-builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 1rem;
}

.panel-card--query-builder {
  width: 100%;
  margin-bottom: 1rem;
}

.entry-form--query-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.query-group-card {
  border: 1px solid var(--line, #d9e5f2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  padding: 1rem;
  margin-left: calc(var(--query-depth, 0) * 0.65rem);
  box-shadow: 0 10px 28px rgba(14, 30, 58, 0.06);
}

.query-group-card--root {
  margin-left: 0;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(255, 255, 255, 0.94));
}

.query-group-card__header,
.query-code-preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.query-group-card__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.query-group-card__body {
  display: grid;
  gap: 0.85rem;
}

.query-value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
  max-height: 48vh;
  overflow: auto;
  padding-right: 0.35rem;
}

.pill-row--expression {
  gap: 0.55rem;
  align-items: flex-start;
}

.pill--query {
  white-space: normal;
  max-width: 100%;
}

.filter-summary-bar--interactive {
  cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--hubspot-line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, white), rgba(255, 255, 255, 0.98));
  text-align: left;
  width: 100%;
}

.filter-summary-bar--interactive:hover {
  box-shadow: 0 10px 28px rgba(22, 48, 84, 0.08);
}

.contact-pool-summary-stack {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.contact-pool-summary-stack--embedded {
  gap: 8px;
  margin-bottom: 0;
  padding: 10px 12px;
  border-bottom: 1px solid #d8e3ef;
  background: #ffffff;
  position: relative;
  z-index: 1;
}

.query-summary-card {
  display: grid;
  gap: 0.55rem;
  justify-items: stretch;
  width: 100%;
  max-width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--hubspot-line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, white), rgba(255, 255, 255, 0.98));
  box-shadow: 0 8px 24px rgba(22, 48, 84, 0.06);
  text-align: left;
}

.query-summary-card:hover {
  box-shadow: 0 12px 28px rgba(22, 48, 84, 0.1);
}

.query-summary-card .pill-row {
  flex-wrap: wrap;
}

.query-summary-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.assignment-actions--left {
  justify-content: flex-start;
}

.entry-form--query-values {
  margin-bottom: 1rem;
}

.list-card--interactive {
  cursor: pointer;
}

.list-card--interactive:focus-visible {
  outline: 3px solid rgba(65, 159, 255, 0.22);
  outline-offset: 2px;
}

.filter-row-card--query {
  grid-template-columns: minmax(180px, 0.9fr) minmax(140px, 0.65fr) minmax(220px, 1.1fr) auto;
  align-items: start;
  margin-left: calc(var(--query-depth, 0) * 0.65rem);
}

.query-rule-actions {
  display: inline-flex;
  gap: 0.6rem;
  align-self: end;
  flex-wrap: nowrap;
}

.filter-control--compact {
  min-width: 132px;
}

.filter-control--query-value textarea {
  min-height: 104px;
  resize: vertical;
}

.query-code-preview {
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-top: 1px solid rgba(186, 205, 227, 0.75);
  padding-top: 1rem;
}

.query-code-preview__body {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: #0f1d2f;
  color: #edf5ff;
  font-size: 0.86rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.query-value-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2300;
  background: rgba(15, 23, 38, 0.42);
  display: grid;
  place-items: center;
  padding: 2rem;
  backdrop-filter: blur(4px);
}

.query-value-modal {
  width: min(1120px, 94vw);
  max-height: 88vh;
  overflow: hidden;
  display: grid;
  gap: 1rem;
}

.entry-form--query-values {
  grid-template-columns: minmax(0, 1fr);
}

.query-value-modal .query-value-grid {
  max-height: min(52vh, 540px);
}

@media (max-width: 1100px) {
  .entry-form--query-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .entry-form--query-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .query-value-modal-backdrop {
    padding: 1rem;
  }
}

.list-card--template .assignment-actions--inline,
.list-card__top-actions .assignment-actions--inline {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
}

.list-card__top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.panel-card--template-editor {
  width: 100%;
}

.list-card--template {
  cursor: pointer;
}

.list-card--template:focus-visible {
  outline: 3px solid rgba(65, 159, 255, 0.26);
  outline-offset: 2px;
}

.list-card--template {
  cursor: pointer;
}

.list-card--template:focus-visible {
  outline: 3px solid rgba(65, 159, 255, 0.26);
  outline-offset: 2px;
}

.list-card__top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.assignment-actions--inline {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
}

.panel-card--template-editor {
  width: 100%;
}

/* Keep project contact-status tint visible in the final rendered table state. */
.contact-pool-row.contact-pool-row--status {
  border-bottom-color: color-mix(in srgb, var(--contact-status-color) 34%, rgba(223, 231, 239, 0.9));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--contact-status-color) 17%, #ffffff) 0%,
    color-mix(in srgb, var(--contact-status-color) 11%, #f7fbfd) 100%
  );
}

.contact-pool-row.contact-pool-row--status:hover {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--contact-status-color) 23%, #ffffff) 0%,
    color-mix(in srgb, var(--contact-status-color) 16%, #f5f9fc) 100%
  );
}

body.crm-theme-dark .contact-pool-row.contact-pool-row--status {
  border-bottom-color: color-mix(in srgb, var(--contact-status-color) 30%, rgba(255, 255, 255, 0.1));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--contact-status-color) 18%, #142335) 0%,
    color-mix(in srgb, var(--contact-status-color) 12%, #112033) 100%
  );
}

body.crm-theme-dark .contact-pool-row.contact-pool-row--status:hover {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--contact-status-color) 22%, #17273c) 0%,
    color-mix(in srgb, var(--contact-status-color) 16%, #132235) 100%
  );
}

.assignment-actions--spread {
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

#contactColumnsModal .assignment-actions--spread > .assignment-actions {
  gap: 5px;
}

.user-editor-action {
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.user-editor-action--invite:hover {
  background: linear-gradient(180deg, #e1ecff 0%, #d0e0ff 100%);
  border-color: rgba(69, 116, 217, 0.44);
  color: #173f80;
}

.user-editor-action--save:hover {
  background: linear-gradient(180deg, #19975c 0%, #0e7346 100%);
  border-color: rgba(14, 122, 76, 0.72);
  color: #ffffff;
}

.user-editor-action--delete:hover {
  background: linear-gradient(180deg, #ffe3e8 0%, #ffc8d0 100%);
  border-color: rgba(200, 77, 87, 0.4);
  color: #9f3244;
}

.contact-columns-panel {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  min-height: 0;
}

.contact-columns-selected-panel,
.contact-columns-available-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #f7fbff);
  min-height: 0;
}

.contact-columns-selected-list {
  display: grid;
  gap: 0.75rem;
  max-height: min(58vh, 640px);
  overflow: auto;
  padding-right: 0.3rem;
}

.contact-columns-selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  border-radius: 16px;
  background: #fff;
  cursor: grab;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.contact-columns-selected-item:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.contact-columns-selected-item.is-dragging {
  opacity: 0.68;
  cursor: grabbing;
}

.contact-columns-selected-item.is-drop-target {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
  transform: translateY(-1px);
}

.contact-columns-selected-item__meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.contact-columns-selected-item__meta strong,
.contact-columns-option__meta strong {
  display: block;
  font-size: 0.96rem;
  color: var(--ink);
}

.contact-columns-selected-item__meta p,
.contact-columns-option__meta span {
  margin: 0.16rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: capitalize;
}

.contact-columns-selected-item__index {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.contact-columns-selected-item__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.contact-columns-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-columns-option {
  justify-content: space-between;
  gap: 1rem;
}

.contact-columns-option__meta {
  min-width: 0;
}

.contact-columns-option__meta strong,
.contact-columns-option__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .contact-columns-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 680px) {
  .contact-columns-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-columns-selected-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .contact-columns-selected-item__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.contacts-ops-chooser {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contacts-ops-choice-card {
  display: grid;
  gap: 0.85rem;
  padding: 1.4rem;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 8%, white) 0%, transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
  text-align: left;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.contacts-ops-choice-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.1);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
}

.contacts-ops-choice-card h4 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
}

.contacts-ops-choice-card__cta {
  color: var(--accent);
  font-weight: 700;
}

.contacts-ops-page {
  display: grid;
  gap: 1rem;
}

.contacts-import-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.contacts-import-hero__card {
  display: grid;
  gap: 0.55rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  box-shadow: var(--shadow-soft);
}

.contacts-import-layout,
.contacts-export-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.55fr);
  gap: 1rem;
  align-items: start;
}

.contacts-import-layout__sidebar,
.contacts-export-layout__filters {
  position: sticky;
  top: 0;
  display: grid;
  gap: 1rem;
}

.contacts-import-layout__main,
.contacts-export-layout__preview {
  display: grid;
  gap: 1rem;
}

.contacts-import-sidebar__actions {
  display: grid;
  gap: 0.75rem;
}

.contacts-import-mapping-list {
  display: grid;
  gap: 0.85rem;
}

.import-history-list {
  display: grid;
  gap: 0.85rem;
}

.import-history-row {
  display: grid;
  gap: 0.8rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.import-history-row__meta,
.import-history-row__actions,
.import-history-row__summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.import-history-row__meta strong {
  font-size: 1rem;
}

.import-history-row__meta p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.import-history-row__stats,
.import-history-row__summary {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.import-history-row__summary span {
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 6%, white);
  color: var(--muted);
  font-weight: 600;
}

.import-history-row__actions {
  justify-content: flex-end;
}

.import-history-row__download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--warning) 12%, white);
  color: var(--warning-strong);
  font-weight: 700;
  text-decoration: none;
}

.import-history-row__download:hover {
  background: color-mix(in srgb, var(--warning) 20%, white);
}

.contacts-import-map-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.9fr);
  gap: 1rem;
  align-items: end;
}

.import-mapping-combobox {
  width: 100%;
}

.contacts-import-map-card__meta h4 {
  margin: 0.2rem 0;
  font-size: 1.05rem;
}

.import-mapping-input {
  width: 100%;
}

.contacts-import-progress {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.contacts-import-progress__bar {
  height: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, white);
  overflow: hidden;
}

.contacts-import-progress__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #63b2ff);
}

.contacts-import-progress--page,
.contacts-import-summary-page {
  width: 100%;
}

.contacts-import-progress-page {
  gap: 1rem;
  padding: 1.2rem;
}

.contacts-import-progress-page__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.contacts-import-progress-page__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 7%, white);
  color: var(--muted);
  font-weight: 600;
}

.contacts-import-summary-page {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
}

.contacts-import-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.contacts-import-summary-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
  min-height: 132px;
  padding: 1rem 1.1rem;
  color: rgba(255, 255, 255, 0.96);
  border: 0;
  box-shadow: none;
}

.contacts-import-summary-card .section-kicker,
.contacts-import-summary-card h3,
.contacts-import-summary-card p {
  color: inherit;
}

.contacts-import-summary-card .section-kicker {
  opacity: 0.82;
}

.contacts-import-summary-card h3 {
  margin: 0.55rem 0 0;
  font-size: 2rem;
  line-height: 1;
}

.contacts-import-setup__toggle {
  margin: 0.15rem 0 0.85rem;
}

.contacts-import-setup__toggle.is-disabled {
  opacity: 0.58;
}

.contacts-import-summary-chart {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contacts-import-summary-chart__segment {
  min-height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  color: #fff;
  font-weight: 700;
}

.contacts-import-summary-chart__segment span {
  white-space: nowrap;
}

.contacts-import-summary-chart__segment--success,
.report-card--import-success {
  background: linear-gradient(180deg, #1f9d63 0%, #157347 100%);
}

.contacts-import-summary-chart__segment--accent,
.report-card--import-accent {
  background: linear-gradient(180deg, #2f80ed 0%, #1b63bd 100%);
}

.contacts-import-summary-chart__segment--warning,
.report-card--import-warning {
  background: linear-gradient(180deg, #d99310 0%, #b77907 100%);
}

.contacts-import-summary-chart__segment--danger,
.report-card--import-danger {
  background: linear-gradient(180deg, #d05b63 0%, #b33d47 100%);
}

.contacts-import-summary-chart__segment--neutral,
.report-card--import-neutral {
  background: linear-gradient(180deg, #54637a 0%, #334155 100%);
}

.feature-line--warning {
  border-left: 3px solid #d99310;
  padding-left: 10px;
}

.report-table__mapping-row th {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, white);
}

.report-table__mapping-cell--ignored {
  color: var(--muted) !important;
  background: color-mix(in srgb, #f59e0b 10%, white) !important;
}

.report-table__mapping-cell--ignored span {
  display: inline-flex;
  align-items: center;
  padding: 0.26rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, #f59e0b 18%, white);
  color: #8a5a00;
}

@media (max-width: 1024px) {
  .contacts-ops-chooser,
  .contacts-import-hero,
  .contacts-import-layout,
  .contacts-export-layout,
  .contacts-import-map-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .contacts-import-layout__sidebar,
  .contacts-export-layout__filters {
    position: static;
  }

  .contacts-import-progress-page__meta {
    flex-direction: column;
  }
}

.user-directory-grid--panels {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.queue-row--panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.panel-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
}

.panel-runtime-shell {
  margin-top: 1rem;
}

.panel-runtime-selector {
  display: grid;
  gap: 0.35rem;
  min-width: 220px;
}

.panel-runtime-layout {
  display: grid;
  gap: 1rem;
}

.panel-runtime-layout--columns-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-runtime-layout--columns-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-runtime-card {
  min-height: 100%;
}

.panel-runtime-field-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.panel-runtime-html {
  display: grid;
  gap: 0.75rem;
  min-height: 260px;
}

.panel-runtime-text {
  white-space: pre-wrap;
}

@media (max-width: 1024px) {
  .panel-runtime-layout--columns-2,
  .panel-runtime-layout--columns-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .queue-row--panel {
    flex-direction: column;
  }

  .panel-card__actions {
    justify-content: flex-start;
  }
}

/* Final dark-mode polish override */
body.crm-theme-dark {
  --hubspot-bg: #10161d;
  --hubspot-surface: #18212b;
  --hubspot-surface-alt: #1d2834;
  --hubspot-border: #2c3949;
  --hubspot-border-strong: #39506a;
  --hubspot-text: #edf3fa;
  --hubspot-muted: #9fb0c2;
  --hubspot-blue: #6ea8ff;
  --hubspot-blue-strong: #4b92ff;
  --hubspot-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  --surface: #18212b;
  --surface-soft: #1d2834;
  --surface-muted: #223040;
  --line: #2c3949;
  --line-strong: #39506a;
  --ink: #edf3fa;
  --muted: #9fb0c2;
  --shell-nav-surface: #16202a;
  --shell-nav-border: rgba(137, 157, 180, 0.12);
  --shell-nav-text: #f5f8fd;
  --shell-nav-muted: rgba(181, 197, 216, 0.76);
}

body.crm-theme-dark,
body.crm-theme-dark .main-panel,
body.crm-theme-dark .app-shell {
  background: #10161d;
  color: var(--ink);
}

body.crm-theme-dark .sidebar,
body.crm-theme-dark .global-topbar,
body.crm-theme-dark .hero {
  background: #16202a !important;
  border-color: var(--shell-nav-border) !important;
}

body.crm-theme-dark .sidebar::before {
  opacity: 0.14;
}

body.crm-theme-dark .sidebar-nav-shell,
body.crm-theme-dark .sidebar-card,
body.crm-theme-dark .panel-card,
body.crm-theme-dark .workspace-shell,
body.crm-theme-dark .workspace-section,
body.crm-theme-dark .project-config-box,
body.crm-theme-dark .list-card,
body.crm-theme-dark .stat-card,
body.crm-theme-dark .assignment-row,
body.crm-theme-dark .agent-panel,
body.crm-theme-dark .field-admin-row,
body.crm-theme-dark .filter-row-card,
body.crm-theme-dark .detail-card,
body.crm-theme-dark .queue-row,
body.crm-theme-dark .contact-pool-row,
body.crm-theme-dark .pagination-bar,
body.crm-theme-dark .pagination-page,
body.crm-theme-dark .feature-line,
body.crm-theme-dark .report-item,
body.crm-theme-dark .template-preview-card,
body.crm-theme-dark .workspace-empty,
body.crm-theme-dark .filter-box,
body.crm-theme-dark .contact-columns-option,
body.crm-theme-dark .agent-topbar,
body.crm-theme-dark .report-table,
body.crm-theme-dark .template-preview,
body.crm-theme-dark .workspace-panel,
body.crm-theme-dark .modal-card,
body.crm-theme-dark .modal-card__header,
body.crm-theme-dark .global-search-results,
body.crm-theme-dark .user-menu-dropdown,
body.crm-theme-dark .contacts-ops-choice-card,
body.crm-theme-dark .contacts-import-hero__card,
body.crm-theme-dark .contacts-import-map-card,
body.crm-theme-dark .panel-runtime-card,
body.crm-theme-dark .panel-runtime-shell,
body.crm-theme-dark .contact-columns-sidebar,
body.crm-theme-dark .contact-columns-lane,
body.crm-theme-dark .contact-columns-available,
body.crm-theme-dark .company-detail-tab,
body.crm-theme-dark .agent-insight-card,
body.crm-theme-dark .agent-contact-summary--hubspot,
body.crm-theme-dark .agent-record-workspace-header,
body.crm-theme-dark .agent-record-rail__header,
body.crm-theme-dark .agent-workspace-kpi,
body.crm-theme-dark .readonly-field-card,
body.crm-theme-dark .project-ui-block,
body.crm-theme-dark .project-builder-field,
body.crm-theme-dark .response-list-row,
body.crm-theme-dark .email-log-card,
body.crm-theme-dark .query-builder-card,
body.crm-theme-dark .query-node,
body.crm-theme-dark .field-definition-card,
body.crm-theme-dark .response-modal-panel,
body.crm-theme-dark .response-scriptlet-shell,
body.crm-theme-dark .agent-record-column__header,
body.crm-theme-dark .agent-record-center-header,
body.crm-theme-dark .agent-contact-summary,
body.crm-theme-dark .agent-record-fact,
body.crm-theme-dark .agent-detail-tabs--hubspot,
body.crm-theme-dark .agent-side-card,
body.crm-theme-dark .email-verify-embed {
  background: #18212b !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

body.crm-theme-dark .agent-contact-summary--hubspot,
body.crm-theme-dark .agent-record-workspace-header,
body.crm-theme-dark .agent-record-rail__header,
body.crm-theme-dark .agent-record-column__header,
body.crm-theme-dark .agent-record-center-header {
  background: #1b2530 !important;
}

body.crm-theme-dark input,
body.crm-theme-dark select,
body.crm-theme-dark textarea,
body.crm-theme-dark input[disabled],
body.crm-theme-dark textarea[disabled],
body.crm-theme-dark #globalSearch,
body.crm-theme-dark .multi-select-picker__trigger,
body.crm-theme-dark .multi-select-picker__dropdown,
body.crm-theme-dark .multi-select-picker__search-input {
  background: #111922 !important;
  color: var(--ink) !important;
  border-color: #334152 !important;
}

body.crm-theme-dark input::placeholder,
body.crm-theme-dark textarea::placeholder,
body.crm-theme-dark #globalSearch::placeholder {
  color: #7f92a7 !important;
}

body.crm-theme-dark .ghost-button,
body.crm-theme-dark .secondary-button,
body.crm-theme-dark .ghost-link {
  background: #202b37 !important;
  color: var(--ink) !important;
  border-color: #334152 !important;
}

body.crm-theme-dark .ghost-button:hover,
body.crm-theme-dark .secondary-button:hover,
body.crm-theme-dark .ghost-link:hover {
  background: #263444 !important;
}

body.crm-theme-dark .primary-button {
  background: #4f92ff !important;
  color: #f8fbff !important;
  border-color: #4f92ff !important;
}

body.crm-theme-dark .primary-button:hover {
  background: #3f84f0 !important;
}

body.crm-theme-dark .danger-button {
  background: #6a3138 !important;
  color: #fdecef !important;
  border-color: #86444d !important;
}

body.crm-theme-dark .global-topbar h2,
body.crm-theme-dark #topbarTitle,
body.crm-theme-dark .brand-title,
body.crm-theme-dark .nav-chip,
body.crm-theme-dark .nav-subchip,
body.crm-theme-dark .section-heading h3,
body.crm-theme-dark .workspace-section__header h4,
body.crm-theme-dark .detail-section-title,
body.crm-theme-dark .modal-card h4,
body.crm-theme-dark .readonly-field-card__value,
body.crm-theme-dark .agent-workspace-kpi strong,
body.crm-theme-dark .agent-record-fact strong {
  color: var(--shell-nav-text) !important;
}

body.crm-theme-dark .hero .eyebrow,
body.crm-theme-dark .topbar-context .eyebrow,
body.crm-theme-dark .sidebar .eyebrow,
body.crm-theme-dark .nav-submenu-label,
body.crm-theme-dark .brand-copy,
body.crm-theme-dark .queue-row__sub,
body.crm-theme-dark .workspace-copy,
body.crm-theme-dark .readonly-field-card__label,
body.crm-theme-dark .agent-workspace-kpi span,
body.crm-theme-dark .agent-record-fact span,
body.crm-theme-dark .detail-caption,
body.crm-theme-dark .list-card__subtitle,
body.crm-theme-dark .list-card__meta,
body.crm-theme-dark label,
body.crm-theme-dark .field-help,
body.crm-theme-dark .section-kicker {
  color: var(--shell-nav-muted) !important;
}

body.crm-theme-dark .nav-chip.is-active,
body.crm-theme-dark .nav-subchip.is-active,
body.crm-theme-dark .workspace-tab.is-active,
body.crm-theme-dark .response-list-row.is-selected,
body.crm-theme-dark .agent-detail-tabs--hubspot .agent-detail-tab.is-active {
  background: rgba(79, 146, 255, 0.14) !important;
  color: #f5f8fd !important;
  border-color: rgba(79, 146, 255, 0.24) !important;
}

body.crm-theme-dark .workspace-tabs,
body.crm-theme-dark .agent-detail-tabs--hubspot,
body.crm-theme-dark .contact-pool-row--header,
body.crm-theme-dark .crm-list-toolbar,
body.crm-theme-dark .report-table th,
body.crm-theme-dark .response-list-row__content {
  background: #1a2430 !important;
}

body.crm-theme-dark .workspace-tab,
body.crm-theme-dark .agent-detail-tabs--hubspot .agent-detail-tab {
  color: var(--muted) !important;
  background: transparent !important;
  border-color: var(--line) !important;
}

body.crm-theme-dark .response-list-row:hover,
body.crm-theme-dark .queue-row:hover,
body.crm-theme-dark .list-card:hover,
body.crm-theme-dark .global-search-result:hover,
body.crm-theme-dark .global-search-result:focus,
body.crm-theme-dark .contact-pool-row:hover {
  background: #202b37 !important;
}

body.crm-theme-dark .status-pill,
body.crm-theme-dark .badge,
body.crm-theme-dark .badge--soft {
  background: #223140 !important;
  color: #dbe8f8 !important;
  border-color: #33495f !important;
}

body.crm-theme-dark .report-table td,
body.crm-theme-dark .report-table th,
body.crm-theme-dark .table-shell td,
body.crm-theme-dark .table-shell th {
  border-color: var(--line) !important;
}

body.crm-theme-dark .assignment-actions--wrapup {
  background: linear-gradient(180deg, rgba(24, 33, 43, 0), rgba(24, 33, 43, 0.96) 24%) !important;
}

body.crm-theme-dark .email-verify-embed iframe {
  background: #fff;
}

.field-admin-row--backup {
  gap: 16px;
}

.field-admin-row--backup .feature-list {
  margin-top: 0;
}

.daily-revenue-filters {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr) minmax(460px, 1.35fr);
  gap: 14px;
  align-items: end;
}

.daily-revenue-summary {
  margin-top: 18px;
}

.daily-revenue-panel {
  margin-top: 20px;
}

.daily-revenue-chart-shell {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 14px 0 8px;
}

.daily-revenue-chart {
  min-width: 1120px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.daily-revenue-chart__axis {
  position: relative;
  min-height: 430px;
}

.daily-revenue-chart__axis-row {
  position: absolute;
  left: 0;
  right: 0;
  transform: translateY(50%);
}

.daily-revenue-chart__columns {
  position: relative;
  min-height: 430px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding: 20px 8px 0;
}

.daily-revenue-chart__columns::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 36px;
  height: 1px;
  background: rgba(120, 138, 163, 0.18);
}

.daily-revenue-chart__columns::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 108px;
  height: 2px;
  background: rgba(73, 96, 130, 0.4);
}

.daily-revenue-column {
  position: relative;
  width: 86px;
  flex: 0 0 86px;
  display: grid;
  grid-template-rows: 272px 2px 98px auto;
  gap: 0;
}

.daily-revenue-column--interactive {
  cursor: pointer;
}

.daily-revenue-column--interactive:focus-visible {
  outline: 2px solid rgba(57, 103, 255, 0.32);
  outline-offset: 6px;
  border-radius: 18px;
}

.daily-revenue-column__positive,
.daily-revenue-column__negative {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.daily-revenue-column__stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 0;
}

.daily-revenue-column__segment {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  border-radius: 0;
}

.daily-revenue-column__segment span {
  display: block;
}

.daily-revenue-column__segment--revenue {
  background: #ff5a7d;
  border-radius: 16px 16px 0 0;
}

.daily-revenue-column__segment--leads {
  background: #ff9f43;
  min-height: 54px;
  border-radius: 0 0 16px 16px;
}

.daily-revenue-column__segment--dnq {
  background: #c7ccd5;
  color: #243447;
  border-radius: 0 0 14px 14px;
}

.daily-revenue-column__baseline {
  width: 100%;
}

.daily-revenue-column__footer {
  padding-top: 12px;
  display: grid;
  gap: 8px;
  text-align: center;
}

.daily-revenue-column__footer strong {
  font-size: 13px;
  color: #223140;
}

.daily-revenue-column__footer span {
  font-size: 11px;
  color: #738398;
}

.daily-revenue-column__percentage {
  display: grid;
  gap: 6px;
  text-align: left;
}

.daily-revenue-column__percentage-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: #6f8297;
}

.daily-revenue-column__percentage-meta strong {
  font-size: 11px;
  color: #223140;
}

.daily-revenue-column__percentage-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e8eef7;
  overflow: hidden;
}

.daily-revenue-column__percentage-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #84d9b7 0%, #2fb67c 100%);
}

.daily-revenue-column__tooltip {
  position: absolute;
  left: 50%;
  bottom: 288px;
  transform: translate(-50%, -12px);
  min-width: 172px;
  max-width: 210px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(19, 24, 30, 0.88);
  color: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 34, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 4;
}

.daily-revenue-column:hover .daily-revenue-column__tooltip {
  opacity: 1;
  transform: translate(-50%, -20px);
}

.daily-revenue-tooltip__row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.daily-revenue-tooltip__swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex: 0 0 12px;
}

.daily-revenue-tooltip__swatch--leads {
  background: #ff9f43;
}

.daily-revenue-tooltip__swatch--percentage {
  background: #31c0c9;
}

.daily-revenue-tooltip__swatch--revenue {
  background: #ff5a7d;
}

.daily-revenue-tooltip__swatch--dnq {
  background: #c7ccd5;
}

.daily-revenue-chart__grid {
  stroke: rgba(120, 138, 163, 0.18);
  stroke-width: 1;
}

.daily-revenue-chart__baseline {
  stroke: rgba(73, 96, 130, 0.4);
  stroke-width: 1.5;
}

.daily-revenue-chart__bar--revenue {
  fill: #ff8c42;
}

.daily-revenue-chart__bar--dnq {
  fill: #d84e68;
}

.daily-revenue-chart__axis-label,
.daily-revenue-chart__agent-label,
.daily-revenue-chart__team-label,
.daily-revenue-chart__value,
.daily-revenue-chart__bar-label,
.daily-revenue-chart__dnq-label {
  font-family: inherit;
}

.daily-revenue-chart__axis-label {
  fill: #5f6f84;
  font-size: 11px;
}

.daily-revenue-chart__agent-label {
  fill: #1e2b3a;
  font-size: 11px;
  font-weight: 700;
}

.daily-revenue-chart__team-label {
  fill: #6e7f95;
  font-size: 10px;
}

.daily-revenue-chart__value {
  fill: #1d2a38;
  font-size: 11px;
  font-weight: 700;
}

.daily-revenue-chart__bar-label,
.daily-revenue-chart__dnq-label {
  fill: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.daily-revenue-chart__dnq-value {
  fill: #b33e55;
  font-size: 11px;
  font-weight: 700;
}

.daily-revenue-range {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.daily-revenue-range > label,
.agent-performance-range > label {
  min-width: 0;
}

.agent-performance-range {
  grid-template-columns: minmax(170px, 0.7fr) minmax(180px, 0.65fr) minmax(180px, 0.65fr);
  align-items: end;
}

.agent-performance-range input,
.agent-performance-range select {
  width: 100%;
}

.agent-performance-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
}

.agent-performance-summary .stat-card {
  min-height: 0;
}

.agent-performance-sections {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.agent-performance-campaigns {
  width: 100%;
}

.filter-combobox {
  position: relative;
}

.filter-combobox__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  min-width: 100%;
  width: max-content;
  max-width: min(620px, calc(100vw - 120px));
  z-index: 40;
  display: none;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 8px;
}

.filter-combobox.is-open .filter-combobox__menu {
  display: grid;
  gap: 4px;
}

.filter-combobox__option,
.filter-combobox__empty {
  width: 100%;
  border: 0;
  background: var(--surface);
  border-radius: 10px;
  padding: 11px 12px;
  text-align: left;
  color: inherit;
}

.filter-combobox__option {
  display: grid;
  gap: 4px;
}

.filter-combobox__option strong {
  color: #173a59;
  font-size: 0.93rem;
  line-height: 1.25;
}

.filter-combobox__option span {
  color: #68829b;
  font-size: 0.78rem;
  line-height: 1.25;
}

.filter-combobox__option:hover,
.filter-combobox__option.is-highlighted {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

.filter-combobox__option.is-selected {
  font-weight: 700;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 20%, white), color-mix(in srgb, var(--accent) 12%, white));
  color: color-mix(in srgb, var(--accent) 70%, #10243d);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 32%, white);
}

.filter-combobox__option.is-selected strong {
  color: inherit;
}

.filter-combobox__empty {
  color: var(--muted);
}

.inline-filter--project-picker {
  min-width: 0;
}

.reporting-home {
  display: grid;
  gap: 22px;
}

.reporting-home__body {
  display: grid;
  grid-template-columns: minmax(240px, 286px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.reporting-home__sidebar {
  display: grid;
  gap: 22px;
  align-content: start;
}

.reporting-sidebar-search input {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #d4dfec;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.reporting-sidebar-group {
  display: grid;
  gap: 12px;
}

.reporting-sidebar-group__title {
  font-size: 1rem;
  font-weight: 800;
  color: #334e68;
}

.reporting-sidebar-nav {
  display: grid;
  gap: 4px;
}

.reporting-sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: none;
  border-left: 4px solid transparent;
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: #516a85;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.reporting-sidebar-link:hover {
  background: #edf5fc;
  color: #215c8f;
}

.reporting-sidebar-link.is-active {
  border-left-color: #16a1c9;
  background: #dff5fb;
  color: #214e78;
}

.reporting-sidebar-link__count {
  color: inherit;
  font-weight: 800;
}

.reporting-home__main {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.reporting-home-card {
  display: grid;
  gap: 0;
  border: 1px solid #d6e1ec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(23, 42, 58, 0.04);
  overflow: hidden;
}

.reporting-home-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 18px;
}

.reporting-home-card__header h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #21354d;
}

.reporting-library-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid #d6e1ec;
  border-radius: 10px 10px 0 0;
  border-bottom: none;
  overflow: hidden;
}

.reporting-library-tab {
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-right: 1px solid #d6e1ec;
  background: #f5f8fb;
  color: #4b6683;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.reporting-library-tab:last-child {
  border-right: none;
}

.reporting-library-tab.is-active {
  background: #fff;
  color: #1e567f;
}

.reporting-library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.reporting-library-toolbar__search {
  flex: 1 1 360px;
  max-width: 460px;
}

.reporting-library-toolbar__search input {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #d4dfec;
  background: #fff;
}

.reporting-home-card--library {
  padding: 0 0 10px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.reporting-library-shell {
  border: 1px solid #d6e1ec;
  border-radius: 0 0 12px 12px;
  background: #fff;
  overflow: auto;
}

.reporting-library-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
}

.reporting-library-table thead th {
  padding: 14px 12px;
  border-bottom: 1px solid #d6e1ec;
  background: #edf4fb;
  color: #38526d;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
}

.reporting-library-table tbody td {
  padding: 16px 12px;
  border-bottom: 1px solid #e5edf5;
  vertical-align: middle;
  color: #314a63;
}

.reporting-library-table tbody tr:hover {
  background: #f8fbfe;
}

.reporting-library-cell--check,
.reporting-library-cell--favorite {
  width: 46px;
}

.reporting-library-name {
  display: grid;
  gap: 4px;
}

.reporting-library-name strong {
  color: #1180aa;
  font-size: 1rem;
}

.reporting-library-name span {
  color: #6d8399;
  font-size: 0.86rem;
}

.reporting-library-star {
  border: none;
  background: transparent;
  color: #9bb1c6;
  font-size: 1.2rem;
  cursor: pointer;
}

.reporting-library-star.is-active {
  color: #efb32f;
}

.reporting-library-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.reporting-library-cell--actions {
  text-align: right;
}

.danger-text-button {
  color: #c84f5b;
}

.danger-text-button:hover {
  color: #a83c48;
}

@media (max-width: 1180px) {
  .reporting-home__body {
    grid-template-columns: 1fr;
  }

  .reporting-library-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .reporting-library-toolbar__search {
    max-width: none;
  }
}

.reporting-project-picker {
  min-width: 0;
}

.reporting-project-picker .filter-combobox__menu {
  gap: 4px;
}

.reporting-projects-layout {
  align-items: start;
}

.reporting-projects-sidebar,
.reporting-projects-detail {
  display: grid;
  gap: 14px;
  min-height: 0;
  align-content: start;
  align-self: start;
}

.reporting-projects-sidebar {
  grid-template-rows: auto auto auto;
}

.reporting-projects-detail {
  grid-template-rows: minmax(0, 1fr);
}

.reporting-projects-sidebar__header {
  padding-bottom: 4px;
}

.reporting-projects-sidebar__filters {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  align-items: end;
}

.reporting-projects-sidebar__list,
.reporting-projects-detail__body {
  min-height: 0;
  align-self: start;
}

.reporting-projects-detail__body {
  display: grid;
  align-content: start;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.workload-planner-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
}

.workload-planner-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.workload-planner-focus {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workload-planner-toolbar .inline-filter {
  min-width: 170px;
}

.workload-planner-callout {
  margin-top: 1rem;
}

.workload-planner-progress {
  display: grid;
  gap: 8px;
  margin: 10px 0 8px;
}

.workload-planner-progress__meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--hubspot-muted);
}

.workload-planner-progress__track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: #e8eef5;
  overflow: hidden;
}

.workload-planner-progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #3f82c3 0%, #53b7a3 100%);
}

.workload-planner-progress__expected {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 3px;
  border-radius: 999px;
  background: #c84d57;
  transform: translateX(-50%);
  z-index: 2;
}

.workload-planner-row {
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.workload-planner-row:hover {
  background: rgba(18, 115, 234, 0.04);
}

.workload-planner-status-pill {
  font-weight: 800;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--status-color, #5c728a) 18%, white);
}

@media (max-width: 1180px) {
  .reporting-projects-sidebar__filters {
    grid-template-columns: 1fr;
  }

  .workload-planner-layout {
    grid-template-columns: 1fr;
  }

  .workload-planner-toolbar {
    align-items: stretch;
  }

  .workload-planner-focus {
    justify-content: flex-start;
  }
}

.reporting-projects-detail__body .detail-shell {
  display: grid;
  gap: 14px;
}

.reporting-projects-detail__body .detail-card {
  padding: 20px 22px;
}

.agent-history-page,
.agent-history-section {
  min-height: 0;
}

.agent-history-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}

.agent-history-table-shell {
  overflow: auto;
  min-height: 0;
  max-height: calc(100vh - 290px);
}

.report-table--history tbody tr {
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.report-table--history tbody tr:hover {
  background: color-mix(in srgb, var(--agent-history-status-color, var(--accent)) 8%, white);
}

.agent-history-row td:first-child {
  box-shadow: inset 3px 0 0 var(--agent-history-status-color, var(--line));
}

.agent-history-row__link {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.reporting-projects-detail__body .detail-title {
  gap: 14px;
}

.reporting-projects-detail__body .report-grid {
  gap: 14px;
}

.reporting-projects-detail__body .report-list,
.reporting-projects-detail__body .stack-list {
  gap: 12px;
}

.reporting-projects-sidebar__list .reporting-project-group + .reporting-project-group {
  margin-top: 14px;
}

.reporting-projects-sidebar .reporting-project-grid {
  grid-template-columns: 1fr;
}

body.crm-theme-dark .filter-combobox__menu {
  background: #162131;
}

body.crm-theme-dark .filter-combobox__option,
body.crm-theme-dark .filter-combobox__empty {
  background: #1b2738;
}

body.crm-theme-dark .filter-combobox__option:hover,
body.crm-theme-dark .filter-combobox__option.is-highlighted {
  background: color-mix(in srgb, var(--accent) 14%, #1b2738);
}

body.crm-theme-dark .daily-revenue-chart__grid {
  stroke: rgba(255, 255, 255, 0.08);
}

body.crm-theme-dark .daily-revenue-chart__columns::before {
  background: rgba(255, 255, 255, 0.08);
}

body.crm-theme-dark .daily-revenue-chart__columns::after {
  background: rgba(255, 255, 255, 0.18);
}

body.crm-theme-dark .daily-revenue-chart__axis-label,
body.crm-theme-dark .daily-revenue-column__footer span {
  fill: #97a8bc;
  color: #97a8bc;
}

body.crm-theme-dark .daily-revenue-column__footer strong {
  color: #e5edf7;
}

body.crm-theme-dark .daily-revenue-column__percentage-meta {
  color: #b1c3d8;
}

body.crm-theme-dark .daily-revenue-column__percentage-meta strong {
  color: #f4f7fb;
}

body.crm-theme-dark .daily-revenue-column__percentage-track {
  background: rgba(132, 157, 189, 0.22);
}

body.crm-theme-dark .daily-revenue-column__segment--dnq {
  background: #9da6b4;
  color: #0f1720;
}

body.crm-theme-dark .daily-revenue-column__tooltip {
  background: rgba(10, 14, 20, 0.94);
}

.daily-revenue-agent-modal__summary {
  margin-top: 18px;
}

.daily-revenue-agent-modal__projects {
  margin-top: 20px;
}

@media (max-width: 1180px) {
  .email-log-summary-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .daily-revenue-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-revenue-range {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .email-log-summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-revenue-filters,
  .daily-revenue-range {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  .report-builder-columns-layout {
    grid-template-columns: 1fr;
  }

  .field-admin-grid--team-inline {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-admin-actions--team {
    justify-content: flex-start;
    white-space: normal;
  }

  .entry-form--agent-tracker {
    grid-template-columns: minmax(0, 1fr);
  }

  .agent-tracker-filters-row,
  .agent-tracker-filters-row--secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .agent-tracker-filters-row,
  .agent-tracker-filters-row--secondary {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Agent workspace launcher refresh */
.agent-launcher--refined {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - var(--shell-topbar-height) - 166px);
  align-content: stretch;
}

.agent-launcher-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
  gap: 18px;
  padding: 22px 24px;
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 12%, white) 0%, transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f5f9fd 100%);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.07);
}

.agent-launcher-hero__copy {
  display: grid;
  gap: 10px;
  align-content: start;
}

.agent-launcher-hero__copy h3 {
  margin: 0;
  font-size: clamp(1.55rem, 2vw, 2.1rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.agent-launcher-hero__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.agent-launcher-stat--hero {
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--line));
  background: rgba(255, 255, 255, 0.84);
}

.agent-launcher-library {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 14px;
  padding: 20px 22px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  min-height: 0;
  overflow: hidden;
}

.agent-launcher-library__header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.agent-launcher-library__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-launcher-library__summary .render-summary {
  margin: 0;
}

.agent-project-grid--refined {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.agent-project-card--refined {
  display: grid;
  grid-template-rows: auto auto auto auto auto auto 1fr;
  grid-auto-flow: row;
  grid-auto-rows: max-content;
  align-items: start;
  justify-items: stretch;
  appearance: none;
  position: relative;
  min-width: 0;
  width: 100%;
  min-height: 400px;
  padding: 18px;
  gap: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  align-content: start;
  overflow: hidden;
  text-align: left;
}

.agent-project-card--refined > * {
  min-width: 0;
  align-self: start;
}

.agent-project-card--refined:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
}

.agent-project-card__eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.agent-project-card__code {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, white);
  color: var(--accent);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.agent-project-card__titleblock {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.agent-project-card--refined h4 {
  margin: 0;
  font-size: 1.16rem;
  line-height: 1.12;
  letter-spacing: -0.04em;
  font-family: "Lexend", "Plus Jakarta Sans", sans-serif;
  overflow-wrap: anywhere;
}

.agent-project-card__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.35;
}

.agent-project-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.agent-project-card__badges span {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.2;
}

.agent-project-card__progress {
  display: grid;
  gap: 7px;
  width: 100%;
}

.agent-project-card__progress-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.86rem;
}

.agent-project-card__progress-top strong {
  color: var(--text);
  font-size: 0.98rem;
}

.agent-project-card__progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-strong);
  overflow: hidden;
}

.agent-project-card__progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 58%, white));
}

.agent-project-card__stats--refined {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.agent-project-card__stats--refined span {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  min-width: 0;
}

.agent-project-card__stats--refined small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.agent-project-card__stats--refined strong {
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.agent-project-card__meta--refined {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.agent-project-card__meta--refined span {
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.84rem;
}

.agent-project-card__cta {
  width: 100%;
  margin-top: auto;
  align-self: end;
}

body.crm-theme-dark .agent-launcher-hero,
body.crm-theme-dark .agent-launcher-library,
body.crm-theme-dark .agent-project-card--refined {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.96));
  border-color: var(--line);
  box-shadow: none;
}

body.crm-theme-dark .agent-launcher-stat--hero,
body.crm-theme-dark .agent-project-card__badges span,
body.crm-theme-dark .agent-project-card__stats--refined span,
body.crm-theme-dark .agent-project-card__meta--refined span {
  background: rgba(15, 23, 42, 0.7);
  border-color: var(--line);
}

body.crm-theme-dark .agent-project-card__code {
  background: rgba(15, 23, 42, 0.8);
  border-color: var(--line);
}

@media (max-width: 1120px) {
  .agent-launcher-hero {
    grid-template-columns: 1fr;
  }

  .agent-launcher-hero__stats,
  .agent-project-card__stats--refined {
    grid-template-columns: 1fr 1fr;
  }

  .agent-project-grid--refined {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .agent-launcher-hero,
  .agent-launcher-library,
  .agent-project-card--refined {
    padding: 16px;
    border-radius: 18px;
  }

  .agent-launcher-hero__stats,
  .agent-project-card__stats--refined,
  .agent-project-grid--refined {
    grid-template-columns: 1fr;
  }

  .agent-launcher-library__header,
  .agent-project-card__eyebrow {
    align-items: start;
    flex-direction: column;
  }

  .agent-project-card__progress-top {
    flex-direction: column;
    align-items: start;
  }
}

/* Canonical surface and agent-workspace layout overrides */
.panel-card,
.workspace-shell,
.workspace-section,
.detail-card,
.list-card,
.filter-row-card,
.contact-columns-option,
.stat-card,
.render-summary,
.crm-table-shell,
.filter-summary-bar,
.template-preview-card,
.workspace-empty,
.utility-block,
.report-table,
.report-item {
  border-radius: 16px;
  background: var(--hubspot-surface);
  border: 1px solid var(--hubspot-border);
  box-shadow: none;
}

.panel-card {
  padding: 18px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.pagination-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  background: var(--hubspot-surface);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.report-table th,
.report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.84rem;
}

.report-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #f7fafc;
}

.report-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

/* Canonical shared table layout */
.contact-pool-list > .crm-table-shell {
  overflow-x: auto;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.contact-pool-list .contact-pool-row {
  width: max-content;
  min-width: 100%;
}

/* Canonical Agent Workspace layout */
.agent-launcher--refined {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - var(--shell-topbar-height) - 166px);
  align-content: stretch;
}

.agent-launcher-library {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  align-content: stretch;
  min-height: 0;
  overflow: hidden;
}

.agent-launcher--hubspot {
  min-height: calc(100vh - var(--shell-topbar-height) - 150px);
}

.agent-launcher-library--hubspot {
  gap: 0;
  padding: 0;
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}

.agent-launcher-pagehead {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding: 20px 26px 12px;
  border-bottom: 1px solid #dbe7f3;
}

.agent-launcher-pagehead__title {
  display: grid;
  gap: 2px;
}

.agent-launcher-pagehead__title h3 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.agent-launcher-pagehead__title p {
  margin: 0;
  color: #5e738c;
  font-size: 0.94rem;
  font-weight: 600;
}

.agent-launcher-filterbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 26px 12px;
  border-bottom: 1px solid #dbe7f3;
}

.agent-launcher-filterbar__left,
.agent-launcher-filterbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.agent-launcher-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: min(460px, 100%);
  width: min(460px, 100%);
}

.agent-launcher-search input {
  width: 100%;
  min-height: 46px;
  padding: 0 44px 0 15px;
  border-radius: 6px;
  border: 1px solid #cfdceb;
  background: #ffffff;
  color: #223a57;
  font-size: 0.98rem;
}

.agent-launcher-search__icon {
  position: absolute;
  right: 14px;
  color: #87a0ba;
  font-size: 1rem;
  pointer-events: none;
}

.agent-launcher-status-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  min-width: 180px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #cfdceb;
  background: #ffffff;
  color: #35516f;
  font-size: 0.92rem;
  font-weight: 700;
}

.agent-launcher-status-filter select {
  width: 100%;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: #223a57;
  font: inherit;
  padding-right: 18px;
}

.agent-project-directory {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
}

.agent-project-directory__header,
.agent-project-card--refined {
  display: grid;
  grid-template-columns: minmax(260px, 1.8fr) minmax(180px, 1.1fr) 100px 120px 120px 120px minmax(180px, 1.2fr);
  align-items: center;
  gap: 16px;
}

.agent-project-directory__header {
  padding: 0 26px;
  min-height: 42px;
  background: #f3f8fc;
  border-bottom: 1px solid #dbe7f3;
  color: #35516f;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.agent-project-directory__body {
  min-height: 0;
  overflow-y: auto;
}

.agent-project-grid--refined {
  display: block;
  min-height: 0;
}

.agent-project-card--refined {
  appearance: none;
  position: static;
  width: 100%;
  height: 78px;
  min-height: 78px;
  padding: 0 26px;
  border: 0;
  border-bottom: 1px solid #e3edf7;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  text-align: left;
  transition: background-color 140ms ease;
  grid-template-rows: none;
  grid-auto-flow: column;
  grid-auto-rows: auto;
  justify-items: stretch;
  align-content: center;
  overflow: visible;
}

.agent-project-card--refined:hover {
  transform: none;
  box-shadow: none;
  border-color: #e3edf7;
  background: #f8fbfe;
}

.agent-project-card--refined > span {
  min-width: 0;
  padding: 8px 0;
  align-self: center;
}

.agent-project-row__name,
.agent-project-row__owner,
.agent-project-row__status {
  display: grid;
  gap: 2px;
}

.agent-project-row__name-main,
.agent-project-row__owner-main {
  color: #1293bf;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.2;
}

.agent-project-row__owner-main {
  color: #243f5d;
  font-weight: 700;
}

.agent-project-row__name-sub,
.agent-project-row__owner-sub,
.agent-project-row__status-sub {
  color: #6b819b;
  font-size: 0.8rem;
  line-height: 1.2;
}

.agent-project-row__metric {
  color: #243f5d;
  font-size: 0.94rem;
  font-weight: 700;
}

.agent-project-row__status {
  justify-items: start;
}

.agent-project-row__status .status-pill {
  min-height: 24px;
  padding: 4px 10px;
}

body.crm-theme-dark .agent-launcher-library--hubspot,
body.crm-theme-dark .agent-project-card--refined {
  background: #0f172a;
}

body.crm-theme-dark .agent-launcher-pagehead,
body.crm-theme-dark .agent-launcher-viewbar,
body.crm-theme-dark .agent-launcher-filterbar,
body.crm-theme-dark .agent-project-directory__header,
body.crm-theme-dark .agent-project-card--refined {
  border-color: var(--line);
}

body.crm-theme-dark .agent-project-directory__header {
  background: rgba(15, 23, 42, 0.88);
}

body.crm-theme-dark .agent-project-card--refined:hover {
  background: rgba(30, 41, 59, 0.62);
}

body.crm-theme-dark .agent-launcher-search input {
  background: rgba(15, 23, 42, 0.72);
  border-color: var(--line);
  color: var(--text);
}

body.crm-theme-dark .agent-launcher-status-filter {
  background: rgba(15, 23, 42, 0.72);
  border-color: var(--line);
  color: var(--text);
}

body.crm-theme-dark .agent-launcher-status-filter select {
  color: var(--text);
}

@media (max-width: 1200px) {
  .agent-project-directory__header,
  .agent-project-card--refined {
    grid-template-columns: minmax(220px, 1.8fr) minmax(160px, 1.1fr) 90px 110px 110px 110px minmax(160px, 1.1fr);
    gap: 12px;
  }
}

@media (max-width: 980px) {
  .agent-launcher-pagehead,
  .agent-launcher-viewbar,
  .agent-launcher-filterbar {
    padding-left: 18px;
    padding-right: 18px;
  }

  .agent-launcher-filterbar {
    flex-direction: column;
    align-items: stretch;
  }

  .agent-launcher-search {
    width: 100%;
    min-width: 0;
  }

  .agent-project-directory {
    margin: 0;
  }

  .agent-project-directory__header {
    display: none;
  }

  .agent-project-card--refined {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 14px 16px;
  }

  .agent-project-card--refined > span {
    padding: 4px 0;
  }
}

.agent-list-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.agent-list-shell.is-filter-open {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 25%);
}

.agent-list-shell__main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding-bottom: 0;
}

.contact-workspace-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid #dbe6f1;
  background: #f7fbff;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.contact-workspace-mode-switch__tab {
  border: 0;
  background: transparent;
  color: #4d6883;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.contact-workspace-mode-switch__tab.is-active {
  background: #ffffff;
  color: #163a5d;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.contact-pool-list--agent {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1 1 auto;
  overflow: hidden;
  gap: 10px;
  padding-bottom: 0;
}

.agent-list-table-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: auto;
  padding: 0 0 4px;
}

.contact-pool-footer--agent {
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  justify-content: center;
}

.contact-pool-footer--agent .pagination-bar {
  margin-inline: auto;
}

/* Final table and dark-surface authority block */
.contact-pool-row {
  min-height: 36px;
  padding: 4px 10px;
  gap: 10px;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  box-shadow: none;
}

.contact-pool-row:first-child {
  border-top: 1px solid var(--line);
}

.contact-pool-row--header {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 38px;
  padding: 0 10px;
  background: #f5f8fb;
  box-shadow: none;
}

.contact-pool-row--header span {
  font-size: 0.68rem;
}

body.crm-theme-dark .panel-card,
body.crm-theme-dark .workspace-shell,
body.crm-theme-dark .workspace-section,
body.crm-theme-dark .detail-card,
body.crm-theme-dark .list-card,
body.crm-theme-dark .crm-table-shell,
body.crm-theme-dark .pagination-bar,
body.crm-theme-dark .filter-summary-bar,
body.crm-theme-dark .template-preview-card,
body.crm-theme-dark .workspace-empty,
body.crm-theme-dark .report-table,
body.crm-theme-dark .report-table th {
  background: #18212b;
  border-color: var(--line);
  color: var(--ink);
}

body.crm-theme-dark .contact-pool-row {
  background: transparent;
  border-color: var(--line);
}

body.crm-theme-dark .contact-pool-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

body.crm-theme-dark .contact-pool-row--header {
  background: #222c3b;
}

/* Shared CRM visual refresh based on the stronger company-directory styling */
.panel-card,
.workspace-shell,
.detail-card,
.list-card,
.filter-row-card,
.crm-table-shell,
.filter-summary-bar,
.workspace-empty,
.report-table,
.report-item {
  border-color: #d8e3ef;
  background: #ffffff;
}

.panel-card {
  padding: 18px;
  border-radius: 16px;
}

.section-heading,
.workspace-header {
  align-items: center;
  gap: 12px;
}

.section-heading h3,
.workspace-header h4 {
  color: #163a59;
  font-weight: 800;
}

.section-kicker {
  color: #5f7891;
  letter-spacing: 0.08em;
}

.inline-filter {
  gap: 6px;
}

.inline-filter > span {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5f7891;
}

.inline-filter input,
.inline-filter select,
.filter-control input,
.filter-control select,
.filter-control textarea {
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid #d8e3ef;
  background: #ffffff;
  box-shadow: none;
}

.inline-filter textarea,
.filter-control textarea {
  min-height: 96px;
}

.primary-button,
.secondary-button,
.ghost-button,
.workspace-header__meta button,
.contact-pool-footer .secondary-button {
  min-height: 40px;
  border-radius: 12px;
  box-shadow: none;
  font-weight: 700;
}

.primary-button {
  background: #ff7a59;
  border-color: #ff7a59;
}

.primary-button:hover {
  background: #f36d4c;
  border-color: #f36d4c;
}

.secondary-button,
.ghost-button,
.workspace-header__meta button {
  background: #ffffff;
  border-color: #d8e3ef;
  color: #35526d;
}

.secondary-button:hover,
.ghost-button:hover,
.workspace-header__meta button:hover {
  background: #f7fafc;
  border-color: #c6d7e8;
}

.badge,
.workspace-header__meta .badge {
  min-height: 26px;
  padding: 10px;
  border-radius: 999px;
  background: #e7eff8;
  border: 1px solid #d3e0ec;
  color: #315678;
}

.workspace-tabs {
  gap: 0;
  padding: 0;
  border-bottom: 1px solid #d8e3ef;
}

.workspace-tab,
.workspace-tabs button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px 12px 0 0;
  background: #f8fbfe;
  border-color: #d8e3ef;
  color: #35526d;
  font-weight: 700;
}

.workspace-tab.is-active,
.workspace-tabs button.is-active {
  background: #ffffff;
  color: #163a59;
  box-shadow: inset 0 -2px 0 #3f82c3;
}

.filter-summary-bar {
  padding: 10px 12px;
  border-radius: 14px;
  background: #f8fbfe;
}

.crm-table-shell,
.report-table-wrap {
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
}

.contact-pool-row--header,
.report-table th {
  background: #f5f8fb;
  border-bottom-color: #d8e3ef;
}

.contact-pool-row,
.report-table td {
  border-bottom-color: #e3ebf3;
}

.contact-pool-row:hover,
.report-table tbody tr:hover,
.response-list-row:hover {
  background: #f9fbfd;
}

.response-list-row {
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: none;
}

.response-list-row.is-selected {
  background: #eef5fc;
  border-color: #bfd4e8;
}

.pagination-bar {
  border: 1px solid #d8e3ef;
  background: #ffffff;
}

.workspace-empty {
  padding: 22px;
  color: #627b93;
  background: #f8fbfe;
}

body.crm-theme-dark .panel-card,
body.crm-theme-dark .workspace-shell,
body.crm-theme-dark .detail-card,
body.crm-theme-dark .list-card,
body.crm-theme-dark .filter-row-card,
body.crm-theme-dark .crm-table-shell,
body.crm-theme-dark .filter-summary-bar,
body.crm-theme-dark .workspace-empty,
body.crm-theme-dark .report-table,
body.crm-theme-dark .report-table-wrap,
body.crm-theme-dark .report-item,
body.crm-theme-dark .response-list-row {
  background: #18212b;
  border-color: #2b3a4d;
}

body.crm-theme-dark .inline-filter input,
body.crm-theme-dark .inline-filter select,
body.crm-theme-dark .filter-control input,
body.crm-theme-dark .filter-control select,
body.crm-theme-dark .filter-control textarea,
body.crm-theme-dark .secondary-button,
body.crm-theme-dark .ghost-button,
body.crm-theme-dark .workspace-header__meta button {
  background: #16202c;
  border-color: #32465d;
  color: var(--ink);
}

body.crm-theme-dark .badge,
body.crm-theme-dark .workspace-header__meta .badge {
  background: #223246;
  border-color: #31455d;
  color: #d7e4f2;
}

body.crm-theme-dark .workspace-tab,
body.crm-theme-dark .workspace-tabs button {
  background: #16202c;
  border-color: #31455d;
  color: #bfd0e0;
}

body.crm-theme-dark .workspace-tab.is-active,
body.crm-theme-dark .workspace-tabs button.is-active {
  background: #1b2634;
  color: #ffffff;
  box-shadow: inset 0 -2px 0 #6aa7de;
}

.workspace-tabs--project-editor {
  margin-top: 12px;
  align-self: start;
  background: transparent;
  border-bottom: 1px solid #d8e3ef;
  padding: 0;
  gap: 0;
}

.workspace-tabs--project-editor .workspace-tab {
  min-height: 44px;
  background: #f8fbfe;
  border-color: #d8e3ef;
  color: #35526d;
  box-shadow: none;
}

.workspace-tabs--project-editor .workspace-tab.is-active {
  background: #ffffff;
  color: #163a59;
  box-shadow: inset 0 -2px 0 #5e7f9c;
}

.project-admin-card {
  background: #ffffff;
  border-color: #d8e3ef;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.project-admin-preview-card {
  border-style: dashed;
}

.project-admin-field--full {
  grid-column: 1 / -1;
}

.project-admin-inline-label > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-help-button {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #c8d7e6;
  background: #f4f8fb;
  color: #44627f;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
}

.inline-help-button:hover {
  background: #eaf2f8;
  border-color: #b5cade;
}

.project-admin-products-card {
  gap: 16px;
}

.project-admin-product-list {
  display: grid;
  gap: 10px;
}

.project-admin-product-card {
  border: 1px solid #d8e3ef;
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
}

.project-admin-product-card__open {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
}

.project-admin-product-card__open:hover {
  background: #f9fbfd;
}

.project-admin-product-card__main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-admin-product-card__main h4 {
  margin: 0;
  color: #163a59;
  font-size: 1rem;
}

.project-admin-product-card__main p:last-child {
  margin: 0;
  color: #6b7f94;
  font-size: 0.86rem;
}

.project-admin-product-card__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.project-admin-product-card__meta .badge {
  padding: 0 10px;
}

.project-admin-product-card__meta .badge:first-child {
  margin-left: auto;
}

.project-admin-product-list .workspace-empty {
  border: 1px dashed #d8e3ef;
  border-radius: 16px;
  background: #fbfdff;
}

.project-additional-modal-shell .country-combobox {
  width: 100%;
}

.project-additional-modal-shell .country-combobox__trigger {
  min-height: 44px;
}

.project-admin-card .multi-select-picker__trigger {
  min-height: 46px;
}

.project-admin-card .multi-select-picker__dropdown {
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
}

.project-additional-editor-list {
  display: grid;
  gap: 14px;
}

.project-additional-field-list {
  display: grid;
  gap: 10px;
}

.project-additional-field-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid #d8e3ef;
  border-radius: 16px;
  background: #ffffff;
  color: #223548;
  text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.project-additional-field-card:hover {
  border-color: #b9cce2;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.project-additional-field-card__main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-additional-field-card__main strong {
  font-size: 0.98rem;
  color: #163a59;
}

.project-additional-field-card__main p {
  margin: 0;
  color: #6b7f94;
  font-size: 0.86rem;
}

.project-additional-field-card__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.project-additional-field-card__meta .badge {
  padding: 0 10px;
}

.project-additional-modal-shell {
  max-height: min(80vh, 820px);
  overflow: hidden;
}

.project-additional-modal-shell label {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #52667c;
}

.project-additional-modal-shell input,
.project-additional-modal-shell select,
.project-additional-modal-shell textarea {
  min-width: 0;
  font-size: 0.93rem;
  text-transform: none;
  letter-spacing: normal;
}

.project-additional-modal-shell textarea {
  min-height: 128px;
  line-height: 1.45;
}

.project-additional-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 2px 2px 0;
  overflow: auto;
}

.project-additional-modal-grid__full {
  grid-column: 1 / -1;
}

.project-additional-visibility-card {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid #d8e3ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
}

.project-additional-visibility-card h5 {
  margin: 4px 0 6px;
  color: #163a59;
  font-size: 1rem;
}

.project-additional-visibility-card .workspace-copy {
  margin: 0;
}

.project-additional-visibility-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field-admin-actions--modal {
  position: sticky;
  bottom: 0;
  margin-top: 16px;
  padding-top: 14px;
  padding-bottom: 2px;
  border-top: 1px solid rgba(111, 145, 191, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), #ffffff 38%);
}

.field-admin-actions__spacer {
  flex: 1 1 auto;
}

body.crm-theme-dark .project-additional-field-card {
  background: #1b2634;
  border-color: #31455d;
  color: #edf4fb;
}

body.crm-theme-dark .workspace-tabs--project-editor {
  border-bottom-color: #31455d;
}

body.crm-theme-dark .workspace-tabs--project-editor .workspace-tab {
  background: #16202c;
  border-color: #31455d;
  color: #bfd0e0;
}

body.crm-theme-dark .workspace-tabs--project-editor .workspace-tab.is-active {
  background: #1b2634;
  color: #ffffff;
  box-shadow: inset 0 -2px 0 #6f91b4;
}

body.crm-theme-dark .project-admin-card,
body.crm-theme-dark .project-admin-product-card {
  background: #1b2634;
  border-color: #31455d;
}

body.crm-theme-dark .project-admin-product-card__open:hover {
  background: #202c3a;
}

body.crm-theme-dark .project-admin-product-card__main h4 {
  color: #ffffff;
}

body.crm-theme-dark .project-admin-product-card__main p:last-child {
  color: #bfd0e0;
}

body.crm-theme-dark .inline-help-button {
  background: #16202c;
  border-color: #31455d;
  color: #d7e5f2;
}

body.crm-theme-dark .project-additional-field-card__main strong,
body.crm-theme-dark .project-additional-visibility-card h5 {
  color: #ffffff;
}

body.crm-theme-dark .project-additional-field-card__main p,
body.crm-theme-dark .project-additional-modal-shell label {
  color: #bfd0e0;
}

body.crm-theme-dark .project-additional-visibility-card {
  background: linear-gradient(180deg, #192330 0%, #16202c 100%);
  border-color: #31455d;
}

body.crm-theme-dark .field-admin-actions--modal {
  border-top-color: #31455d;
  background: linear-gradient(180deg, rgba(22, 32, 44, 0.1), #16202c 40%);
}

@media (max-width: 900px) {
  .project-additional-field-card,
  .project-additional-visibility-grid,
  .project-additional-modal-grid {
    grid-template-columns: 1fr;
  }

  .project-additional-field-card {
    gap: 12px;
  }

  .project-additional-field-card__meta {
    justify-content: flex-start;
  }

  .project-admin-product-card__open {
    grid-template-columns: 1fr;
  }

  .project-admin-product-card__meta {
    justify-content: flex-start;
  }
}

body.crm-theme-dark .contact-pool-row--header,
body.crm-theme-dark .report-table th {
  background: #223042;
  border-bottom-color: #31455d;
}

body.crm-theme-dark .contact-pool-row:hover,
body.crm-theme-dark .report-table tbody tr:hover,
body.crm-theme-dark .response-list-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

body.crm-theme-dark .response-list-row.is-selected {
  background: #213247;
  border-color: #39516b;
}

/* Final Agent Workspace working-list redesign */
.agent-list-header {
  padding-bottom: 12px;
  border-bottom: 1px solid #d8e3ef;
}

.agent-list-header__title {
  display: flex;
  align-items: center;
  min-width: 0;
}

.agent-list-header__tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid #d8e3ef;
  background: #ffffff;
  color: #163a59;
  font-size: 1rem;
  font-weight: 800;
}

.agent-list-header__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7eff8;
  color: #315678;
  font-size: 0.78rem;
  font-weight: 800;
}

.agent-list-header__meta {
  justify-content: flex-end;
}

.agent-list-header__meta:empty {
  display: none;
}

.agent-workspace-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 0 12px;
}

.agent-workspace-toolbar__filters {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-workspace-toolbar__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.contact-pool-toolbar--header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  white-space: normal;
  width: 100%;
  max-width: 100%;
}

.contact-pool-toolbar--header > * {
  flex: 0 0 auto;
}

.contact-workspace-toolbar--shared {
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  row-gap: 8px;
  column-gap: 8px;
}

.contact-workspace-toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.contact-workspace-toolbar-row__left {
  flex: 1 1 260px;
  min-width: 0;
}

.contact-workspace-toolbar-row__right {
  flex: 1 1 520px;
  min-width: 0;
}

.contact-workspace-projectscope-filter {
  min-width: 210px;
  max-width: 280px;
  flex: 0 1 250px;
}

.contact-workspace-toolbar--shared .badge {
  align-self: center;
}

.agent-workspace-list-shell .contact-pool-list--agent {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.contact-list-shell .workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 6;
}

.contact-list-shell {
  height: calc(100vh - var(--shell-topbar-height) - 166px);
  min-height: calc(100vh - var(--shell-topbar-height) - 166px);
}

.contact-list-shell .workspace-header__meta {
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
  overflow: visible;
  width: auto;
  margin-left: auto;
  position: relative;
  z-index: 7;
}

.contact-list-shell .workspace-header__meta:empty {
  display: none;
}

.contact-list-shell .workspace-header > div:first-child {
  min-width: 0;
  flex: 1 1 260px;
}

.contact-workspace-header-actions {
  justify-content: flex-end;
  align-items: center;
  width: auto;
  max-width: 100%;
  position: relative;
  z-index: 7;
}

.contact-workspace-projectscope-filter,
.contact-workspace-projectscope-filter .multi-select-picker {
  position: relative;
  z-index: 7;
}

.agent-workspace-toolbar .agent-product-strip {
  flex: 1 1 auto;
  justify-content: flex-start;
  max-width: none;
}

.contact-pool-list--agent {
  gap: 12px;
}

.contact-list-shell .contact-pool-list--agent {
  display: block;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.filter-summary-bar--inline {
  padding: 10px 12px;
  border-radius: 14px;
  background: #f8fbfe;
  border: 1px solid #d8e3ef;
}

.filter-summary-bar--inline .filter-summary-bar__meta {
  gap: 12px;
}

.filter-summary-bar--inline .pill {
  background: #ffffff;
  border: 1px solid #d8e3ef;
  text-align: center;
}

.agent-list-table-shell {
  padding: 0;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #ffffff;
}

.contact-list-shell .agent-list-table-shell {
  height: 100%;
  max-height: 100%;
}

.contact-list-shell .contact-pool-table-wrap {
  height: 100%;
  max-height: 100%;
}

.contact-pool-row {
  min-height: 44px;
  padding: 6px 14px;
}

.contact-pool-row--header {
  min-height: 40px;
  padding: 0 14px;
  background: #f5f8fb;
  border-bottom-color: #d8e3ef;
}

.contact-pool-row:hover {
  background: #f9fbfd;
}

.contact-pool-footer--agent {
  position: relative;
  padding-top: 12px;
  border-top: 1px solid #d8e3ef;
}

body.crm-theme-dark .agent-list-header {
  border-bottom-color: #2b3a4d;
}

body.crm-theme-dark .agent-list-header__tab,
body.crm-theme-dark .agent-list-table-shell,
body.crm-theme-dark .filter-summary-bar--inline {
  background: #18212b;
  border-color: #2b3a4d;
  color: var(--ink);
}

body.crm-theme-dark .agent-list-header__count {
  background: #223246;
  color: #d7e4f2;
}

body.crm-theme-dark .agent-workspace-toolbar__project-code {
  background: #18212b;
  border-color: #2b3a4d;
  color: var(--ink);
}

/* Final authority for agent detail action buttons */
.topbar-context-actions--agent-detail .agent-context-button {
  background: #ffffff !important;
  border: 1px solid #d8e3ef !important;
  color: #35526d !important;
  box-shadow: none !important;
}

.topbar-context-actions--agent-detail .agent-context-button:hover,
.topbar-context-actions--agent-detail .agent-context-button:focus-visible {
  background: #f7fafc !important;
  border-color: #c6d7e8 !important;
  color: #163a59 !important;
}

.topbar-context-actions--agent-detail .agent-context-button--project {
  background: #ff7a59 !important;
  border-color: #ff7a59 !important;
  color: #ffffff !important;
}

.topbar-context-actions--agent-detail .agent-context-button--project:hover,
.topbar-context-actions--agent-detail .agent-context-button--project:focus-visible {
  background: #f36d4c !important;
  border-color: #f36d4c !important;
  color: #ffffff !important;
}

.topbar-context-actions--agent-detail .agent-context-button--list {
  background: #eef5fc !important;
  border-color: #cfe0ef !important;
  color: #1a5277 !important;
}

.topbar-context-actions--agent-detail .agent-context-button--list:hover,
.topbar-context-actions--agent-detail .agent-context-button--list:focus-visible {
  background: #e1edf8 !important;
  border-color: #c6d7e8 !important;
  color: #163a59 !important;
}

.topbar-context-actions--agent-detail .agent-context-button--nav {
  background: #ffffff !important;
  border-color: #d8e3ef !important;
  color: #35526d !important;
}

.topbar-context-actions--agent-detail .agent-context-button--nav:hover,
.topbar-context-actions--agent-detail .agent-context-button--nav:focus-visible {
  background: #f7fafc !important;
  border-color: #c6d7e8 !important;
  color: #163a59 !important;
}

body.crm-theme-dark .topbar-context-actions--agent-detail .agent-context-button {
  background: #18212b !important;
  border-color: #32465d !important;
  color: var(--ink) !important;
}

body.crm-theme-dark .topbar-context-actions--agent-detail .agent-context-button:hover,
body.crm-theme-dark .topbar-context-actions--agent-detail .agent-context-button:focus-visible {
  background: #223042 !important;
  border-color: #39516b !important;
  color: #ffffff !important;
}

body.crm-theme-dark .topbar-context-actions--agent-detail .agent-context-button--project {
  background: #ff7a59 !important;
  border-color: #ff7a59 !important;
  color: #ffffff !important;
}

body.crm-theme-dark .filter-summary-bar--inline .pill {
  background: #16202c;
  border-color: #32465d;
}

body.crm-theme-dark .contact-pool-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

body.crm-theme-dark .contact-pool-row--header {
  background: #223042;
  border-bottom-color: #31455d;
}

/* Agent Workspace project tabs redesign */
.agent-workspace-project-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  min-height: 100%;
}

.agent-workspace-project-shell.is-filter-open {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.agent-workspace-project-shell__main {
  display: grid;
  gap: 18px;
  min-height: 0;
  padding: 24px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #d7e3f0;
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.06);
}

.agent-workspace-project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e4edf6;
}

.agent-workspace-project-head__identity h3 {
  margin: 4px 0 6px;
  font-size: 33px;
  line-height: 1.08;
  color: #123454;
}

.agent-workspace-project-head__identity p:last-child {
  margin: 0;
  color: #67809b;
  font-size: 14px;
}

.agent-workspace-project-head__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.agent-workspace-project-tabshell {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  flex: 1 1 auto;
}

.agent-workspace-project-tabs {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  padding: 0 0 1px;
  border-bottom: 1px solid #dbe5ef;
}

.agent-workspace-project-tabs__nav {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
  padding: 0 0 8px 12px;
}

.agent-workspace-project-tabs__links,
.agent-workspace-project-tabs__buttons {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.agent-workspace-tabbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  border-bottom: 1px solid #dbe5ef;
}

.agent-workspace-tabbar-controls {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
  padding: 8px 0 8px 16px;
}

.agent-workspace-project-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid #dbe5ef;
  border-bottom-color: #dbe5ef;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, #f8fbfe 0%, #eef4fb 100%);
  color: #476581;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.agent-workspace-project-tab:hover {
  color: #134169;
  background: linear-gradient(180deg, #ffffff 0%, #f4f9fd 100%);
  border-color: #c8d9e8;
  transform: translateY(-1px);
}

.agent-workspace-project-tab.is-active {
  background: #ffffff;
  color: #123454;
  border-color: #c8d9e8;
  border-bottom-color: #ffffff;
  box-shadow: 0 -3px 0 #18b7bb inset, 0 8px 18px rgba(18, 52, 84, 0.08);
  z-index: 2;
}

.agent-workspace-project-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4fb;
  color: #315678;
  font-size: 12px;
  font-weight: 700;
}

.agent-workspace-project-tab.is-active .agent-workspace-project-tab__count {
  background: #dff7f7;
  color: #0e6a6e;
}

.agent-workspace-project-toolbar--hubspot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 0 0 14px;
  border-bottom: 1px solid #e7eef6;
}

.agent-workspace-project-toolbar__left,
.agent-workspace-project-toolbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.agent-workspace-layer-picker,
.agent-workspace-project-search {
  display: grid;
  gap: 6px;
}

.agent-workspace-project-search--inline {
  display: flex;
  align-items: center;
  min-width: 340px;
}

.agent-workspace-layer-picker--inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-workspace-layer-picker--menu {
  position: relative;
  min-width: 290px;
}

.agent-workspace-layer-picker__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #d5e0ec;
  background: #ffffff;
  color: #173552;
  text-align: left;
  box-shadow: none;
}

.agent-workspace-layer-picker__trigger:hover {
  border-color: #bcd1e2;
  background: #f8fbfe;
}

.agent-workspace-layer-picker.is-open .agent-workspace-layer-picker__trigger {
  border-color: #8eb7d8;
  box-shadow: 0 0 0 3px rgba(47, 105, 200, 0.08);
}

.agent-workspace-layer-picker__swatch,
.agent-workspace-layer-option__swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--layer-swatch, #315678);
  flex: 0 0 auto;
}

.agent-workspace-layer-picker__content,
.agent-workspace-layer-option__body {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.agent-workspace-layer-picker__value,
.agent-workspace-layer-option__title {
  color: #173552;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.agent-workspace-layer-picker__caret {
  color: #6f89a5;
  font-size: 12px;
  flex: 0 0 auto;
}

.agent-workspace-layer-picker__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 30;
  display: none;
  padding: 8px;
  border: 1px solid #d5e0ec;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.agent-workspace-layer-picker.is-open .agent-workspace-layer-picker__menu {
  display: grid;
  gap: 6px;
}

.agent-workspace-layer-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #ffffff;
  text-align: left;
}

.agent-workspace-layer-option:hover {
  background: #f7fbff;
  border-color: #dce8f4;
}

.agent-workspace-layer-option.is-active {
  background: #eef6ff;
  border-color: #c7dcf0;
}

.agent-workspace-layer-option__meta {
  color: #7690a8;
  font-size: 12px;
  line-height: 1.2;
}

.agent-workspace-layer-option__check {
  color: #2f69c8;
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}

.agent-workspace-layer-picker__label,
.agent-workspace-project-search__label {
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b8198;
}

.agent-workspace-layer-picker select,
.agent-workspace-project-search input {
  min-height: 36px;
  border-radius: 6px;
  border: 1px solid #d5e0ec;
  background: #ffffff;
  color: #173552;
  font-size: 14px;
  font-weight: 600;
  padding: 0 11px;
  box-shadow: none;
}

.agent-workspace-layer-picker select {
  min-width: 210px;
}

.agent-workspace-project-search input {
  min-width: 320px;
}

.agent-workspace-layer-picker__meta {
  font-size: 12px;
  color: #7690a8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-workspace-project-toolbar__right .secondary-button.secondary-button--compact,
.agent-workspace-project-toolbar__right .ghost-button,
.agent-workspace-project-toolbar__right .primary-button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
  border-color: #d5e0ec;
  box-shadow: none;
}

.agent-workspace-project-toolbar__right .secondary-button.secondary-button--compact {
  background: #ffffff;
  color: #335270;
}

.agent-workspace-project-toolbar__right .secondary-button.secondary-button--compact:hover {
  background: #f7fafc;
  border-color: #bcd1e2;
  color: #163a5d;
}

.agent-workspace-project-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  overflow: hidden;
}

.agent-workspace-project-detail,
.agent-workspace-project-content .panel-card--agent-detail,
.agent-workspace-project-content .detail-shell {
  min-height: 0;
  overflow: hidden;
}

.agent-list-table-shell--hubspot {
  border-radius: 16px;
  overflow: hidden;
}

.agent-workspace-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  height: calc(100vh - var(--shell-topbar-height) - 255px);
  max-height: calc(100vh - var(--shell-topbar-height) - 255px);
  overflow: hidden;
}

.agent-workspace-list-panel .filter-summary-bar {
  margin-bottom: 12px;
}

.agent-workspace-list-panel .agent-list-table-shell--hubspot {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.agent-workspace-list-panel__table-wrap {
  min-height: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  position: relative;
}

.agent-workspace-list-panel.is-loading .pagination-bar {
  pointer-events: none;
  opacity: 0.62;
}

.agent-workspace-list-panel__loading {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d7e3f0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  z-index: 2;
}

.agent-workspace-list-footer__loading {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.agent-workspace-project-detail {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.agent-company-directory {
  border: 1px solid #d7e3f0;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
}

.agent-company-directory__header,
.agent-company-directory__row {
  display: grid;
  grid-template-columns: minmax(180px, 1.45fr) minmax(128px, 0.82fr) 90px 100px 110px 120px 210px;
  gap: 16px;
  align-items: center;
  padding: 0 18px;
}

.agent-company-directory__header {
  min-height: 54px;
  background: #f5f9fd;
  border-bottom: 1px solid #dbe6f1;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #496681;
}

.agent-company-directory__row {
  min-height: 76px;
  border-bottom: 1px solid #e8eef5;
}

.agent-company-directory__row:last-child {
  border-bottom: 0;
}

.agent-company-directory__name,
.agent-company-directory__meta {
  display: grid;
  gap: 4px;
}

.agent-company-directory__name strong {
  color: #0f6cbd;
  font-size: 16px;
}

.agent-company-directory__name small,
.agent-company-directory__meta {
  color: #6f879f;
  font-size: 13px;
}

.agent-company-directory__metric {
  font-size: 15px;
  font-weight: 700;
  color: #163a5d;
}

.agent-company-directory__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  white-space: nowrap;
}

.agent-company-directory__actions .secondary-button,
.agent-company-directory__actions .ghost-button {
  flex: 0 0 auto;
}

.agent-workspace-project-content .contact-pool-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
}

.agent-workspace-project-content .floating-filter-link {
  position: fixed;
  right: 34px;
  bottom: 22px;
  z-index: 18;
  margin-left: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  padding: 6px 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.agent-workspace-project-content .filter-summary-bar {
  margin-bottom: 14px;
}

.agent-workspace-project-content .detail-shell {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.agent-workspace-viewbar--hubspot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 2px 0 2px;
}

.agent-workspace-viewbar__left,
.agent-workspace-viewbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.agent-filter-drawer .assignment-actions--filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.agent-filter-drawer .primary-button,
.agent-filter-drawer .secondary-button,
.agent-filter-drawer .ghost-button {
  width: 100%;
  max-width: none;
}

.agent-filter-drawer .assignment-actions__half {
  width: 100%;
  max-width: none;
}

.agent-filter-drawer #closeAgentFilters {
  width: 100%;
}

.agent-filter-drawer .assignment-actions,
.agent-filter-drawer .assignment-actions--filter-stack,
.agent-filter-drawer .assignment-actions--filter-grid,
.agent-filter-drawer .assignment-actions--filter-stack > button,
.agent-filter-drawer .assignment-actions--filter-grid > button {
  align-self: stretch;
}

.agent-filter-drawer .assignment-actions--filter-stack > button,
.agent-filter-drawer .assignment-actions--filter-grid > button {
  justify-content: center;
}

.agent-filter-drawer [id*="SavedSearches"],
.contact-workspace-toolbar--shared [id*="SavedSearches"] {
  border-color: #b7d6f7;
  background: linear-gradient(180deg, #f3f9ff 0%, #e7f2ff 100%);
  color: #0b63c7;
}

.agent-filter-drawer [id*="SavedSearches"]:hover,
.contact-workspace-toolbar--shared [id*="SavedSearches"]:hover {
  border-color: #97c0ef;
  background: linear-gradient(180deg, #eef7ff 0%, #ddecff 100%);
  color: #084c99;
}

.agent-inline-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0b84b8;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.agent-inline-filter:hover {
  color: #08628a;
}

.agent-inline-filter::after {
  content: "";
  width: 1px;
  height: 18px;
  margin-left: 10px;
  background: #dbe5ef;
}

.agent-inline-filter:last-child::after,
.agent-inline-filter--active::after {
  background: #dbe5ef;
}

.agent-inline-filter.is-active,
.agent-inline-filter--active {
  color: #123454;
}

#agentReviewExcludedButton.agent-inline-filter.is-active {
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d7e3f0;
  background: #eef6ff;
  color: #123454;
  line-height: 1;
}

#agentReviewExcludedButton.agent-inline-filter.is-active::after {
  display: none;
}

.agent-workspace-viewbar--hubspot .pill {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f5f9fd;
  border: 1px solid #d7e3f0;
  color: #56758f;
}

.agent-workspace-viewbar--hubspot .badge {
  min-height: 30px;
  padding: 10px 10px;
}

body.crm-theme-dark .agent-workspace-project-shell__main,
body.crm-theme-dark .agent-company-directory,
body.crm-theme-dark .agent-workspace-project-tab.is-active {
  background: #102235;
  border-color: rgba(148, 163, 184, 0.24);
}

body.crm-theme-dark .agent-workspace-project-head,
body.crm-theme-dark .agent-workspace-project-toolbar--hubspot,
body.crm-theme-dark .agent-workspace-project-tabs,
body.crm-theme-dark .agent-company-directory__header {
  border-color: rgba(148, 163, 184, 0.18);
}

body.crm-theme-dark .agent-workspace-project-head__identity h3,
body.crm-theme-dark .agent-workspace-project-tab.is-active,
body.crm-theme-dark .agent-company-directory__metric,
body.crm-theme-dark .agent-company-directory__name strong {
  color: #e6f0fb;
}

body.crm-theme-dark .agent-workspace-project-head__identity p:last-child,
body.crm-theme-dark .agent-workspace-project-tab,
body.crm-theme-dark .agent-workspace-tabbar-controls,
body.crm-theme-dark .agent-workspace-layer-picker__meta,
body.crm-theme-dark .agent-company-directory__name small,
body.crm-theme-dark .agent-company-directory__meta {
  color: #98a9bd;
}

body.crm-theme-dark .agent-workspace-project-tab {
  background: linear-gradient(180deg, rgba(21, 39, 60, 0.98) 0%, rgba(13, 30, 47, 0.98) 100%);
  border-color: rgba(148, 163, 184, 0.22);
}

body.crm-theme-dark .agent-workspace-project-tab__count {
  background: rgba(59, 130, 246, 0.14);
  color: #cfe4fb;
}

body.crm-theme-dark .agent-workspace-layer-picker select,
body.crm-theme-dark .agent-workspace-project-search input {
  background: #0e1e30;
  border-color: rgba(148, 163, 184, 0.24);
  color: #e6f0fb;
}

body.crm-theme-dark .agent-workspace-layer-picker__trigger,
body.crm-theme-dark .agent-workspace-layer-picker__menu,
body.crm-theme-dark .agent-workspace-layer-option {
  background: #0e1e30;
  border-color: rgba(148, 163, 184, 0.24);
}

body.crm-theme-dark .agent-workspace-layer-picker__trigger:hover,
body.crm-theme-dark .agent-workspace-layer-option:hover {
  background: #13263a;
}

body.crm-theme-dark .agent-workspace-layer-option.is-active {
  background: #15314b;
  border-color: rgba(96, 165, 250, 0.35);
}

body.crm-theme-dark .agent-workspace-layer-picker__value,
body.crm-theme-dark .agent-workspace-layer-option__title {
  color: #e6f0fb;
}

body.crm-theme-dark .agent-workspace-project-toolbar__right .secondary-button.secondary-button--compact {
  background: #0f2236;
  border-color: rgba(148, 163, 184, 0.24);
  color: #dbeafe;
}

body.crm-theme-dark .agent-inline-filter {
  color: #6ec5ef;
}

body.crm-theme-dark .agent-inline-filter.is-active,
body.crm-theme-dark .agent-inline-filter--active {
  color: #f2f7fd;
}

body.crm-theme-dark #agentReviewExcludedButton.agent-inline-filter.is-active {
  background: #15314b;
  border-color: rgba(96, 165, 250, 0.35);
  color: #f2f7fd;
}

body.crm-theme-dark .agent-workspace-project-content .floating-filter-link {
  background: rgba(16, 34, 53, 0.94);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.38);
}

body.crm-theme-dark .agent-inline-filter::after {
  background: rgba(148, 163, 184, 0.24);
}

body.crm-theme-dark .agent-workspace-viewbar--hubspot .pill {
  background: #162536;
  border-color: rgba(148, 163, 184, 0.22);
  color: #a7bdd1;
}

body.crm-theme-dark .agent-workspace-project-tab:hover {
  background: linear-gradient(180deg, rgba(32, 58, 88, 0.98) 0%, rgba(19, 38, 58, 0.98) 100%);
  border-color: rgba(96, 165, 250, 0.34);
}

body.crm-theme-dark .agent-workspace-project-tab.is-active {
  border-bottom-color: #102235;
  box-shadow: 0 -3px 0 #25c7c1 inset, 0 10px 24px rgba(2, 6, 23, 0.28);
}

body.crm-theme-dark .agent-workspace-project-tab.is-active .agent-workspace-project-tab__count {
  background: rgba(37, 199, 193, 0.16);
  color: #c9f8f3;
}

@media (max-width: 1280px) {
  .agent-workspace-project-shell.is-filter-open {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .agent-workspace-tabbar {
    flex-direction: column;
    align-items: stretch;
  }

  .agent-workspace-tabbar-controls {
    padding: 0 0 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .agent-workspace-list-panel {
    height: calc(100vh - var(--shell-topbar-height) - 280px);
    max-height: calc(100vh - var(--shell-topbar-height) - 280px);
  }

  .agent-company-directory__header,
  .agent-company-directory__row {
    grid-template-columns: minmax(176px, 1.35fr) minmax(124px, 0.78fr) repeat(4, minmax(84px, auto)) 210px;
  }

  .agent-workspace-project-search input {
    min-width: 240px;
  }

  .agent-workspace-layer-picker--menu {
    min-width: 260px;
  }
}

@media (max-width: 760px) {
  .agent-workspace-tabbar-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .agent-workspace-project-head,
  .agent-workspace-project-toolbar--hubspot,
  .agent-workspace-project-content .contact-pool-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .agent-workspace-project-content .floating-filter-link {
    right: 18px;
    bottom: 18px;
  }

  .agent-workspace-list-panel {
    height: calc(100vh - var(--shell-topbar-height) - 320px);
    max-height: calc(100vh - var(--shell-topbar-height) - 320px);
  }

  .agent-workspace-project-tabs {
    overflow-x: auto;
  }

  .agent-company-directory {
    overflow-x: auto;
  }

  .agent-company-directory__header,
  .agent-company-directory__row {
    min-width: 980px;
  }

  .agent-workspace-project-search input,
  .agent-workspace-layer-picker--menu {
    min-width: 100%;
  }
}



