:root {
  --ink: #20242b;
  --muted: #6c7480;
  --line: #e5e8ed;
  --panel: #ffffff;
  --canvas: #f4f6f8;
  --navy: #172235;
  --blue: #3676e9;
  --blue-dark: #265fc6;
  --blue-soft: #eaf2ff;
  --mint: #24a978;
  --mint-soft: #e6f7ef;
  --orange: #da7b22;
  --orange-soft: #fff0df;
  --purple: #8058cf;
  --purple-soft: #efe8ff;
  --red: #c84747;
  --red-soft: #fde5e5;
  --shadow: 0 18px 44px rgba(28, 40, 60, .13);
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body {
  margin: 0;
  min-width: 1100px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font: 13px/1.45 Inter, system-ui, sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1 { font: 800 26px Manrope, sans-serif; }
h2 { font: 800 19px Manrope, sans-serif; }
h3 { font-size: 14px; }

.auth-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(460px, 1fr) 1.1fr;
  background: #fff;
}

.auth-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(23,34,53,.96), rgba(39,84,135,.85)),
    url("./assets/crm-hero-background.png") center/cover;
}

.auth-art::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(23,34,53,.15), rgba(23,34,53,.72));
  content: "";
}

.auth-art > * { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font: 800 18px Manrope, sans-serif; text-decoration: none; }
.brand:hover { color: #fff; }
.brand:focus-visible { outline: 2px solid rgba(255,255,255,.65); outline-offset: 4px; }
.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #5aa8ff, #24b27e);
  font-weight: 800;
}
.auth-copy { max-width: 560px; }
.auth-copy h1 { max-width: 520px; font-size: 38px; line-height: 1.05; }
.auth-copy p { margin-top: 14px; color: #d6deea; font-size: 15px; }
.product-showcase {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 14px;
  margin-top: 30px;
}
.showcase-card {
  min-height: 156px;
  overflow: hidden;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.11);
  box-shadow: 0 18px 45px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
}
.showcase-card strong {
  display: block;
  margin-top: 12px;
  color: #fff;
  font: 800 15px Manrope, sans-serif;
}
.showcase-card small {
  display: block;
  margin-top: 4px;
  color: #c7d3e3;
  font-size: 11px;
}
.pipeline-preview {
  display: flex;
  min-height: 238px;
  flex-direction: column;
  justify-content: flex-end;
}
.showcase-head {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.showcase-head span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.42);
}
.pipeline-grid {
  display: grid;
  height: 106px;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 9px;
}
.pipeline-grid span {
  display: block;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #70d9ff, #5a8cff 54%, #7961d9);
}
.image-card {
  min-height: 238px;
  padding: 0;
}
.image-card img {
  display: block;
  width: 100%;
  height: 135px;
  object-fit: cover;
}
.image-card strong,
.image-card small {
  margin-left: 15px;
  margin-right: 15px;
}
.activity-preview {
  display: grid;
  grid-column: 1 / -1;
  min-height: 108px;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
}
.activity-preview div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border-radius: 7px;
  background: rgba(255,255,255,.12);
}
.activity-preview p { min-width: 0; }
.activity-preview strong,
.activity-preview small {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
}
.dot.green { background: #24d18b; }
.dot.blue { background: #70d9ff; }
.dot.orange { background: #ffb45f; }
.hero-note {
  position: relative;
  z-index: 1;
  color: #d6deea;
  font-size: 12px;
  font-weight: 700;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 42px;
  background: #fff;
}
.auth-card { width: 100%; max-width: 430px; }
.auth-card h2 { margin-bottom: 7px; }
.subcopy { color: var(--muted); font-size: 12px; }
.auth-actions { display: grid; gap: 10px; margin-top: 24px; }
.divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--muted); font-size: 11px; }
.divider::before, .divider::after { flex: 1; height: 1px; background: var(--line); content: ""; }

.app-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  color: #c8cfda;
  background: var(--navy);
}
.sidebar .brand { height: 68px; padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; }
.tenant-card {
  margin: 14px 12px 10px;
  padding: 11px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,.05);
}
.tenant-card small, .side-label, .profile small { color: #92a0b3; }
.tenant-card strong { display: block; margin-top: 2px; }
.side-label {
  margin: 18px 18px 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  color: #b7c0cd;
  background: transparent;
  text-align: left;
}
.side-link:hover, .side-link.active { color: #fff; background: rgba(102,151,238,.2); }
.side-link .icon { width: 16px; text-align: center; }
.count { margin-left: auto; color: #91a0b3; font-size: 11px; }
.side-spacer { flex: 1; }
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: #fff;
}

.main { min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 68px;
  padding: 0 25px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.global-search, .table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fafbfc;
}
.global-search { width: 370px; padding: 9px 12px; }
.table-search { width: 250px; padding: 7px 10px; background: #fff; }
.global-search input, .table-search input { width: 100%; border: 0; outline: 0; background: transparent; }
.top-spacer, .toolbar-spacer { flex: 1; }
.top-user { display: flex; align-items: center; gap: 8px; padding-left: 12px; border-left: 1px solid var(--line); font-weight: 700; }
.page { padding: 24px 26px 42px; }
.page-title-row { display: flex; justify-content: space-between; gap: 22px; }
.page-title-row > div:last-child { display: flex; gap: 8px; }

.button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #404956;
  background: #fff;
  font-weight: 700;
}
.button { min-height: 34px; padding: 0 12px; }
.button:hover, .icon-button:hover { background: #f7f8fa; }
.button.primary { border-color: var(--blue); color: #fff; background: var(--blue); }
.button.primary:hover { background: var(--blue-dark); }
.button.danger { color: var(--red); }
.button.ghost { border-color: transparent; background: transparent; }
.button.small { min-height: 28px; padding: 0 9px; font-size: 11px; }
.icon-button { width: 34px; height: 34px; padding: 0; }
.icon-button.small { width: 30px; height: 30px; font-size: 15px; }
.icon-button.danger { color: var(--red); }
.icon-button.is-disabled { opacity: .42; cursor: not-allowed; }
.google-button { width: 100%; }

[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 7px);
  left: 50%;
  min-width: max-content;
  max-width: 180px;
  padding: 5px 7px;
  border-radius: 5px;
  color: #fff;
  background: #20242b;
  content: attr(data-tooltip);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 3px);
  transition: opacity .08s ease, transform .08s ease;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.field { display: grid; gap: 5px; }
.field label { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d9dde4;
  border-radius: 6px;
  outline: 0;
  background: #fff;
}
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #e7f0ff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.error { margin-top: 12px; color: var(--red); font-size: 12px; font-weight: 700; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.summary-card.focus-card {
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
}
.summary-card.focus-card:hover { border-color: #c8dcff; background: #f8fbff; }
.summary-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 8px; font-size: 16px; }
.summary-card small { display: block; color: var(--muted); }
.summary-card strong { display: block; margin-top: 2px; font: 800 18px Manrope, sans-serif; }
.summary-trend { margin-left: auto; color: var(--mint); font-size: 11px; font-weight: 800; }

.view-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.view-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
}
.view-tab.active { border-color: var(--blue); color: var(--blue); font-weight: 800; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 14px 0 12px; }
.filter-pill { color: var(--blue); border-color: #c8dcff; background: var(--blue-soft); }

.board-wrap { overflow: auto; padding-bottom: 6px; }
.group { min-width: 1080px; margin-bottom: 18px; }
.group-heading { display: flex; align-items: center; gap: 8px; padding: 8px 7px; color: var(--group-color); }
.group-heading button { border: 0; color: inherit; background: transparent; }
.group-heading small { color: var(--muted); }
.group-total { margin-left: auto; color: var(--muted); font-weight: 800; }
.crm-table {
  width: 100%;
  table-layout: fixed;
  border-spacing: 0;
  border-collapse: separate;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.crm-table th, .crm-table td {
  height: 42px;
  padding: 0 9px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crm-table th { height: 35px; color: var(--muted); background: #fafbfc; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.crm-table tr:last-child td { border-bottom: 0; }
.crm-table th:last-child, .crm-table td:last-child { border-right: 0; }
.crm-table tbody tr:hover td { background: #fbfcff; }
.select-col { width: 35px; text-align: center; padding: 0; }
.deal-col { width: 218px; }
.owner-col { width: 100px; }
.stage-col { width: 120px; }
.value-col { width: 108px; }
.account-col { width: 140px; }
.date-col { width: 110px; }
.priority-col { width: 92px; }
.more-col { width: 42px; text-align: center; }
.deal-link, .row-more, .add-item { border: 0; background: transparent; }
.deal-link { color: #263247; font-weight: 800; text-align: left; }
.deal-link:hover, .add-item:hover { color: var(--blue); }
.row-more { color: var(--muted); font-size: 18px; }
.add-row td { height: 37px; color: var(--muted); background: #fbfcfd; }

.status-pill, .priority {
  display: inline-block;
  min-width: 72px;
  padding: 4px 8px;
  border-radius: 12px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}
.stage-lead { color: #755214; background: #fff0c7; }
.stage-qualified { color: #28609f; background: #ddebff; }
.stage-proposal { color: #734ca7; background: #eadcff; }
.stage-negotiation { color: #a14b25; background: #ffe1d1; }
.stage-won { color: #18764e; background: #d8f4e8; }
.stage-lost { color: #9a4545; background: #f8dddd; }
.priority-high { color: #ae3d3d; background: #fde1e1; }
.priority-medium { color: #9a6711; background: #fff1ca; }
.priority-low { color: #277c60; background: #dcf4eb; }
.muted { color: var(--muted); }

.avatar, .workspace-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: #6c66d9;
  font-weight: 800;
}
.avatar { width: 26px; height: 26px; font-size: 10px; }
.avatar.small { width: 22px; height: 22px; font-size: 9px; }
.avatar.large { width: 42px; height: 42px; font-size: 13px; }
.owner-cell { display: flex; align-items: center; gap: 6px; }

.kanban { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; overflow: auto; padding: 3px 0 14px; }
.kanban-col { min-height: 430px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f1f3f6; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; padding: 3px 2px 10px; }
.kanban-card { margin-bottom: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card button { border: 0; color: #263247; background: transparent; font-weight: 800; text-align: left; }
.kanban-card p { margin: 7px 0 11px; color: var(--muted); font-size: 11px; }
.kanban-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 800; }

.dashboard, .admin-grid { display: grid; grid-template-columns: 1.3fr .8fr .8fr; gap: 14px; }
.widget { padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.widget h3 { margin-bottom: 15px; }
.widget.wide { grid-column: span 2; }
.funnel-row { display: grid; grid-template-columns: 100px 1fr 70px; align-items: center; gap: 9px; margin: 12px 0; }
.funnel-row small { color: var(--muted); }
.funnel-bar { height: 8px; overflow: hidden; border-radius: 5px; background: #edf0f3; }
.funnel-bar span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.activity-item { display: flex; gap: 9px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.activity-item strong { display: block; color: var(--ink); font-size: 12px; }

.section-toolbar { display: flex; align-items: center; gap: 8px; margin: 20px 0 12px; }
.contact-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.contact-search { width: min(620px, 100%); }
.import-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
.import-strip button,
.import-options button {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}
.import-strip button:hover,
.import-options button:hover {
  border-color: #c8dcff;
  background: #f6f9ff;
}
.import-strip strong,
.import-strip small,
.import-options strong,
.import-options small {
  display: block;
}
.import-strip small,
.import-options small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.list-card, .activity-card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.list-row, .activity-feed-row, .tenant-row {
  display: grid;
  width: 100%;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  text-align: left;
}
.list-row { grid-template-columns: minmax(240px, 1fr) 130px 120px 130px; }
.tenant-row { grid-template-columns: 38px minmax(250px, 1fr) 110px 110px 150px 148px; }
.contact-row { grid-template-columns: 30px minmax(250px, 1fr) 180px 180px 82px; }
.account-row { grid-template-columns: 38px minmax(250px, 1fr) 150px 120px 82px; }
.activity-feed-row { grid-template-columns: 34px minmax(300px, 1fr) 130px 92px 82px; }
.list-row:last-child, .activity-feed-row:last-child, .tenant-row:last-child { border-bottom: 0; }
.list-row:hover, .activity-feed-row:hover, .tenant-row:hover { background: #f8faff; }
.contact-row.is-open { background: #f8faff; }
.inline-contact-row {
  background: #f8faff;
}
.inline-contact-row:hover {
  background: #f8faff;
}
.inline-field-stack {
  display: grid;
  gap: 6px;
}
.inline-add-form {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(140px, 1fr) minmax(120px, .9fr) minmax(150px, 1fr) minmax(120px, .85fr) minmax(110px, .75fr) minmax(88px, .65fr) minmax(118px, .8fr) minmax(96px, .7fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
}
.inline-add-form input,
.inline-add-form select,
.inline-contact-row input,
.inline-contact-row select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 9px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.inline-add-form input:focus,
.inline-add-form select:focus,
.inline-contact-row input:focus,
.inline-contact-row select:focus {
  outline: 2px solid #c8dcff;
  border-color: #7aa7ef;
}
.inline-deal-row td {
  background: #f8faff;
  border-bottom: 1px solid var(--line);
}
.list-primary { display: block; color: #293548; font-weight: 800; }
.list-primary small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.inline-link, .text-link {
  border: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 800;
  text-align: left;
}
.text-link { padding: 0; }
.account-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.account-tags span,
.account-tags button {
  border: 0;
  border-radius: 999px;
  padding: 3px 7px;
  color: #2f5f90;
  background: #eaf2ff;
  font-size: 10px;
  font-weight: 900;
}
.account-tags button { cursor: pointer; }
.account-tag-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.account-tag-editor select {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  background: #fff;
  font-weight: 800;
}
.contact-detail-row {
  padding: 16px 18px 18px 58px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.contact-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 13px;
}
.contact-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.contact-insight {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.contact-insight small,
.contact-insight span {
  display: block;
  color: var(--muted);
}
.contact-insight small {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.contact-insight strong {
  display: block;
  margin: 4px 0 6px;
  color: var(--ink);
}
.contact-insight span { font-size: 11px; }
.row-actions { display: inline-flex; justify-content: flex-end; gap: 6px; }
.admin-notice {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.gmail-notice {
  margin: 4px 0 18px;
}
.gmail-notice.error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  color: #b42318;
  padding: 10px 12px;
}
.account-mark, .activity-symbol {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 10px;
  font-weight: 800;
}
.account-mark.large { width: 52px; height: 52px; border-radius: 14px; font-size: 16px; }
.activity-main { border: 0; background: transparent; text-align: left; }
.task-check {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #cbd2dc;
  border-radius: 50%;
  color: #fff;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
}
.task-check:has(+ .activity-main) {}
.activity-feed-row.completed { opacity: .64; }
.activity-feed-row.completed .task-check, .drawer-task .task-check:not(:empty) { border-color: var(--mint); background: var(--mint); }
.communication-row {
  display: grid;
  width: 100%;
  grid-template-columns: 34px minmax(250px, 1fr) 145px 82px;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}
.communication-row.is-open {
  background: #f8faff;
}
.inbox-thread-row {
  padding: 0 14px 14px 60px;
  border-bottom: 1px solid var(--line);
  background: #f8faff;
}
.inbox-thread-card {
  background: #fff;
}
.invite-row {
  display: grid;
  width: 100%;
  grid-template-columns: 34px minmax(320px, 1fr) 160px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.invite-row:last-child { border-bottom: 0; }
.metric-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: space-between;
  padding: 10px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.attention-row .list-primary { flex: 1; }
.attention-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.attention-reasons span {
  padding: 4px 7px;
  border-radius: 999px;
  color: #8a3a19;
  background: #fff0df;
  font-size: 10px;
  font-weight: 800;
}
.empty-state { padding: 50px; color: var(--muted); text-align: center; }
.empty-state.compact { padding: 18px; }
.home-thread-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.home-thread-card {
  min-width: 0;
}
.home-thread-card .message-bubble {
  max-width: 92%;
}
.home-event-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.home-event-row {
  min-height: 66px;
}
.event-account {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 7px;
  border: 0;
  border-radius: 999px;
  color: #2762b4;
  background: #eaf2ff;
  font-weight: 900;
  cursor: pointer;
  font: inherit;
}
.event-account:hover { background: #dcecff; }

.account-focus-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 13px 15px;
  border: 1px solid #c8dcff;
  border-radius: 8px;
  background: #f4f8ff;
}
.account-focus-banner div { min-width: 0; }
.account-focus-banner strong,
.account-focus-banner small { display: block; }
.account-focus-banner small { color: var(--muted); }
.account-focus-banner .button { margin-left: auto; }
.risk-jump-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #f0b9b9;
  border-radius: 50%;
  color: #a63232;
  background: #fde1e1;
  font: 900 18px Manrope, sans-serif;
}
.risk-jump-button.small {
  width: 30px;
  height: 30px;
  font-size: 15px;
}
.risk-jump-button:hover { background: #fbd1d1; }

.account-profile {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(520px, 1.35fr);
  align-items: stretch;
  gap: 14px;
}
.account-panel {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.account-summary-panel {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 13px;
}
.account-reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.account-reason-chips span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #8a3a19;
  background: #fff0df;
  font-size: 10px;
  font-weight: 800;
}
.account-kpis {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}
.account-kpis span {
  min-width: 0;
  padding: 12px;
  border-radius: 7px;
  background: #f6f8fb;
}
.account-kpis small,
.contact-card dt {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.account-kpis strong { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: #a63232;
  font-size: 11px;
  font-weight: 800;
}
.contact-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.contact-card {
  display: grid;
  grid-template-columns: 30px minmax(0, .78fr) minmax(220px, 1.2fr);
  gap: 11px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.contact-main { min-width: 0; }
.contact-main strong,
.contact-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-main small { margin-top: 2px; color: var(--muted); }
.contact-card dl {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 5px 8px;
  margin: 0;
}
.contact-card dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #334155;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-card a { color: var(--blue); text-decoration: none; }
.correspondence-panel {
  display: flex;
  min-height: 380px;
  flex-direction: column;
}
.thread-list {
  display: grid;
  gap: 12px;
  overflow: auto;
  max-height: 350px;
  padding-right: 5px;
}
.thread-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.thread-card.risk-thread {
  border-color: #f0b9b9;
  background: #fff7f7;
}
.thread-card.risk-thread.is-highlighted {
  box-shadow: 0 0 0 4px #fde1e1, 0 18px 38px rgba(166, 50, 50, .18);
}
.thread-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}
.thread-card header small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}
.risk-label {
  align-self: flex-start;
  padding: 4px 7px;
  border-radius: 999px;
  color: #a63232;
  background: #fde1e1;
  font-size: 10px;
  font-weight: 800;
}
.thread-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.thread-messages {
  display: grid;
  gap: 8px;
}
.message-bubble {
  max-width: 100%;
  padding: 10px 11px;
  border-radius: 8px;
}
.message-bubble small {
  display: block;
  margin-bottom: 4px;
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  opacity: .72;
}
.message-bubble p { color: inherit; }
.message-bubble.customer {
  justify-self: start;
  color: #293548;
  background: #eef2f6;
}
.risk-thread .message-bubble.customer {
  color: #7e2929;
  background: #fde5e5;
}
.message-bubble.team {
  justify-self: end;
  color: #fff;
  background: var(--blue);
}
.reply-composer {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.reply-composer textarea {
  width: 100%;
  min-height: 74px;
  padding: 10px;
  border: 1px solid #d9dde4;
  border-radius: 7px;
  resize: vertical;
}
.reply-composer div {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}
.moments-panel {
  display: flex;
  min-height: 360px;
  flex-direction: column;
}
.moment-list {
  display: grid;
  gap: 9px;
  flex: 1;
  grid-auto-rows: minmax(66px, 1fr);
  max-height: none;
  overflow: auto;
  padding-right: 5px;
  align-content: stretch;
}
.moment-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.moment-date {
  display: grid;
  min-height: 36px;
  place-items: center;
  border-radius: 7px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 800;
}
.moment-row strong,
.moment-row small {
  display: block;
  min-width: 0;
}
.moment-row small {
  margin-top: 3px;
  color: var(--muted);
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(16,25,39,.28);
}
.modal-layer.center { align-items: center; justify-content: center; }
.drawer {
  width: 450px;
  overflow: auto;
  padding: 22px;
  background: #fff;
  box-shadow: -8px 0 30px rgba(20,30,45,.14);
}
.modal {
  width: 500px;
  max-height: 88vh;
  overflow: auto;
  padding: 22px;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}
.modal.import-modal { width: 620px; }
.import-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.import-preview {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.import-map {
  display: grid;
  grid-template-columns: 1fr 1fr 90px;
  gap: 0;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.import-map > * {
  padding: 9px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.import-map > :nth-child(3n) { border-right: 0; }
.import-map > :nth-last-child(-n+3) { border-bottom: 0; }
.import-map span {
  color: var(--muted);
  background: #fafbfc;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.import-map em {
  color: var(--mint);
  font-style: normal;
  font-weight: 800;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.close-button { border: 0; color: var(--muted); background: transparent; font-size: 20px; }
.detail-hero { display: flex; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.detail-section { padding: 17px 0; border-bottom: 1px solid var(--line); }
.detail-section h3 { margin-bottom: 11px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.message-card { padding: 11px; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 8px; }
.message-card small { display: block; margin: 3px 0 7px; color: var(--muted); }
.drawer-task { display: grid; grid-template-columns: 24px 1fr 90px 82px; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.drawer-task small { display: block; color: var(--muted); }
.check-list { display: grid; gap: 9px; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 6px; }
.check-row input { accent-color: var(--blue); }
.check-row span { flex: 1; }
.settings-heading { margin: 18px 0 9px; }
.probability-grid { display: grid; gap: 8px; }
.probability-row { display: grid; grid-template-columns: 1fr 74px 20px; align-items: center; gap: 8px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.field-tag { padding: 6px 9px; border-radius: 14px; color: var(--blue); background: var(--blue-soft); font-weight: 800; }
.settings-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
}
.settings-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}
.settings-tabs button.active {
  border-color: var(--blue);
  color: var(--blue);
}
.settings-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.15fr) minmax(360px, .85fr);
  gap: 14px;
  align-items: start;
}
.settings-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.settings-form {
  display: grid;
  gap: 14px;
}
.check-list.compact {
  gap: 7px;
}
.integration-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.signal-list {
  display: grid;
  gap: 8px;
}
.signal-list h4 {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}
.signal-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fbfcfe;
  text-align: left;
}
.signal-row:hover {
  border-color: #c8dcff;
  background: #f6f9ff;
}

.campaign-layout {
  display: grid;
  grid-template-columns: minmax(300px, .85fr) minmax(520px, 1.25fr);
  gap: 14px;
  align-items: start;
}
.campaign-list {
  display: grid;
  gap: 10px;
}
.campaign-card {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  text-align: left;
  cursor: pointer;
}
.campaign-card:hover,
.campaign-card.is-selected {
  border-color: #c8dcff;
  background: #f6f9ff;
}
.campaign-card strong,
.campaign-card small {
  display: block;
}
.campaign-card small {
  margin-top: 3px;
  color: var(--muted);
}
.campaign-card p {
  margin-top: 8px;
  color: #334155;
}
.campaign-builder {
  display: grid;
  gap: 12px;
}
.campaign-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.campaign-builder .field {
  display: grid;
  gap: 5px;
}
.campaign-builder .field span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.campaign-builder input,
.campaign-builder select,
.campaign-builder textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}
.recipient-preview {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid #c8dcff;
  border-radius: 8px;
  background: #f6f9ff;
}
.recipient-preview span {
  color: var(--muted);
  font-size: 12px;
}
.token-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.token-bar .field-tag {
  border: 0;
  cursor: pointer;
}
.campaign-preview {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.campaign-preview small {
  color: var(--muted);
  font-weight: 800;
}
.campaign-preview h4 {
  margin: 5px 0 9px;
  font-size: 16px;
}
.campaign-preview p {
  color: #334155;
}
.campaign-detail {
  display: grid;
  gap: 12px;
}
.campaign-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.campaign-detail-grid span {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.campaign-detail-grid small,
.campaign-detail-grid strong {
  display: block;
}
.campaign-detail-grid small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.campaign-detail .field {
  display: grid;
  gap: 5px;
}
.campaign-detail textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

@media (max-width: 760px) {
  body { min-width: 0; }
  .auth-screen, .app-shell { display: block; }
  .auth-art { min-height: 360px; padding: 24px; }
  .auth-panel { padding: 24px; }
  .sidebar { min-height: auto; }
  .page { padding: 18px; }
  .inline-add-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inline-add-form .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .settings-layout,
  .integration-metrics {
    grid-template-columns: 1fr;
  }
}
