:root {
  --navy-950: #071d4f;
  --navy-900: #09265f;
  --navy-800: #12366f;
  --blue-600: #1d6cf2;
  --blue-100: #e9f2ff;
  --teal-700: #008f8c;
  --teal-600: #00a39e;
  --teal-100: #e1f6f4;
  --ink: #12234e;
  --text: #3f4e72;
  --muted: #71809e;
  --line: #e4e9f2;
  --surface: #ffffff;
  --canvas: #f7f9fc;
  --shadow: 0 1px 3px rgba(17, 42, 91, 0.04), 0 8px 24px rgba(17, 42, 91, 0.025);
  --sidebar-width: 236px;
  --header-height: 88px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  min-width: 0;
  margin: 0;
  color: var(--text);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.login-page {
  min-width: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(0, 163, 158, 0.17), transparent 34%),
    radial-gradient(circle at 88% 84%, rgba(29, 108, 242, 0.14), transparent 32%),
    var(--navy-950);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
}

.login-card {
  width: min(100%, 440px);
  padding: 42px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 30px 80px rgba(0, 10, 40, 0.32);
}

.login-brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 38px;
  color: var(--navy-950);
  letter-spacing: -1.4px;
}

.login-heading {
  margin-bottom: 28px;
}

.login-eyebrow {
  color: var(--teal-700);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-heading h1 {
  margin: 8px 0 10px;
  color: var(--ink);
  font-size: 29px;
  line-height: 1.2;
  letter-spacing: -0.8px;
}

.login-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.login-form,
.login-field {
  display: grid;
  gap: 9px;
}

.login-form {
  gap: 20px;
}

.login-field label {
  color: var(--ink);
  font-weight: 700;
}

.login-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #ccd5e5;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
}

.login-field input:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(29, 108, 242, 0.12);
  outline: none;
}

.login-field span,
.login-errors {
  color: #b42318;
  font-size: 12px;
}

.login-errors:empty,
.login-errors ul:empty {
  display: none;
}

.login-errors ul {
  margin: 0;
  padding: 11px 14px 11px 30px;
  border-radius: 8px;
  background: #fff1f0;
}

.login-submit {
  min-height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-600), var(--navy-800));
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(29, 108, 242, 0.24);
}

.login-submit:hover {
  filter: brightness(1.06);
}

@media (max-width: 520px) {
  .login-card {
    padding: 32px 24px;
  }
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(29, 108, 242, 0.34);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  display: block;
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
}

.mobile-dashboard,
.mobile-nav {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 30px 20px 24px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin: 3px 9px 36px;
  color: var(--navy-950);
  text-decoration: none;
  letter-spacing: -1.4px;
}

.brand__name {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand__ree {
  font-size: 24px;
  font-weight: 800;
}

.brand__accent {
  color: #168ad3;
}

.brand__crm {
  color: var(--teal-600);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.9px;
}

.brand__version {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.primary-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.nav-link .icon {
  width: 23px;
  height: 23px;
}

.nav-link--active {
  color: #fff;
  background: linear-gradient(135deg, #0a2d70 0%, #08235b 100%);
  box-shadow: 0 5px 16px rgba(7, 35, 91, 0.2);
}

.nav-link--active:hover {
  background: linear-gradient(135deg, #103a83 0%, #0b2a68 100%);
}

.nav-link--disabled {
  cursor: default;
}

.nav-link--disabled:hover {
  color: var(--blue-600);
  background: #f5f8fd;
}

.nav-divider {
  height: 1px;
  margin: 13px 8px 5px;
  background: var(--line);
}

.sidebar-card {
  margin-top: auto;
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  text-align: center;
  box-shadow: var(--shadow);
}

.sidebar-card strong {
  display: block;
  margin: 4px 0 8px;
  color: var(--ink);
  font-size: 14px;
}

.sidebar-card p {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.sidebar-card__art {
  position: relative;
  width: 98px;
  height: 58px;
  margin: 0 auto 8px;
  border-radius: 48% 48% 18% 18%;
  background: linear-gradient(#e8faf9, #f8fcfc);
  overflow: hidden;
}

.house-roof {
  position: absolute;
  z-index: 2;
  top: 17px;
  left: 31px;
  width: 38px;
  height: 38px;
  border: 5px solid #079b9b;
  border-right: 0;
  border-bottom: 0;
  transform: rotate(45deg);
}

.house-body {
  position: absolute;
  z-index: 1;
  left: 32px;
  bottom: 4px;
  width: 38px;
  height: 30px;
  background: #2cb8b2;
}

.house-door,
.house-window {
  position: absolute;
  bottom: 0;
  width: 9px;
  height: 17px;
  background: #fff;
}

.house-door {
  left: 6px;
}

.house-window {
  right: 6px;
  bottom: 10px;
  height: 9px;
}

.tree {
  position: absolute;
  z-index: 3;
  bottom: 3px;
  width: 4px;
  height: 21px;
  background: #487d75;
}

.tree::before {
  position: absolute;
  top: -10px;
  left: -7px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #16aaa2;
  content: "";
}

.tree--left {
  left: 17px;
}

.tree--right {
  right: 14px;
  transform: scale(0.8);
}

.app-workspace {
  grid-column: 2;
  min-width: 0;
}

.top-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  height: var(--header-height);
  align-items: center;
  justify-content: flex-end;
  gap: 28px;
  padding: 0 30px 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.global-search {
  display: flex;
  width: min(540px, 52%);
  height: 48px;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 16px;
  border: 1px solid #dce3ee;
  border-radius: 11px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.global-search:focus-within {
  border-color: #8fb8ff;
  box-shadow: 0 0 0 3px rgba(29, 108, 242, 0.1);
}

.global-search > .icon {
  width: 20px;
  height: 20px;
  color: #59709d;
}

.global-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.global-search input::placeholder {
  color: #8793ab;
}

.global-search kbd {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  box-shadow: 0 1px 1px rgba(11, 39, 90, 0.06);
  font-size: 11px;
}

.header-actions,
.profile {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 18px;
}

.icon-button,
.profile__menu,
.small-icon-button {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover,
.profile__menu:hover {
  color: var(--blue-600);
}

.notification-button {
  position: relative;
  width: 40px;
  height: 40px;
  color: var(--navy-800);
}

.notification-button .icon {
  width: 25px;
  height: 25px;
}

.notification-count {
  position: absolute;
  top: 1px;
  right: 0;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #e93e49;
  font-size: 10px;
  font-weight: 800;
}

.profile {
  gap: 10px;
  padding-left: 0;
  border-left: 0;
}

.profile__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
}

.profile__identity:hover strong {
  color: var(--blue-600);
}

.profile__avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid #dff2f0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #20578b, #0b8f91);
  font-size: 12px;
  font-weight: 800;
}

.profile__copy {
  display: flex;
  min-width: 142px;
  flex-direction: column;
  gap: 3px;
}

.profile__copy strong {
  color: var(--ink);
  font-size: 13px;
}

.profile__copy small {
  color: var(--muted);
  font-size: 11px;
}

.profile__menu {
  width: 30px;
  height: 30px;
}

.profile__menu .icon {
  width: 16px;
}

.main-content {
  min-height: calc(100vh - var(--header-height));
  padding: 26px 28px 18px;
}

.account-heading {
  align-items: center;
}

.account-grid {
  display: grid;
  max-width: 1080px;
  grid-template-columns: minmax(280px, 0.8fr) minmax(440px, 1.35fr);
  gap: 18px;
}

.account-card {
  padding: 24px;
}

.account-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.account-card__header h2 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 17px;
}

.account-card__header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-card__icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--blue-600);
  background: var(--blue-100);
}

.account-card__icon--email {
  color: var(--teal-700);
  background: var(--teal-100);
}

.account-card__icon .icon {
  width: 23px;
  height: 23px;
}

.account-details {
  margin: 3px 0 0;
}

.account-details > div {
  display: grid;
  gap: 5px;
  padding: 15px 0;
  border-bottom: 1px solid #edf0f5;
}

.account-details > div:last-child {
  border-bottom: 0;
}

.account-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.account-details dd {
  margin: 0;
  color: var(--ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 24px;
}

.copy-field input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #ccd7e6;
  border-radius: 9px;
  color: var(--ink);
  background: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.copy-field input:focus {
  border-color: var(--blue-600);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(29, 108, 242, 0.1);
}

.copy-button {
  min-width: 92px;
}

.account-email-help {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.dashboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 4px 22px;
}

.dashboard-heading h1 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.45px;
}

.dashboard-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.dashboard-actions {
  display: flex;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button .icon {
  width: 19px;
  height: 19px;
}

.button--primary,
.campaign-status-options button[aria-pressed="true"] {
  color: #fff;
  border-color: #008d89;
  background: linear-gradient(135deg, #00a9a3, #008e8b);
  box-shadow: 0 5px 14px rgba(0, 143, 140, 0.18);
}

.button--primary:hover,
.campaign-status-options button[aria-pressed="true"]:hover {
  background: linear-gradient(135deg, #00b9b2, #009b97);
  box-shadow: 0 7px 18px rgba(0, 143, 140, 0.24);
}

.button--secondary {
  color: var(--ink);
  border-color: #dce3ee;
  background: #fff;
}

.button--secondary:hover,
.button--outline:hover {
  border-color: #9db8da;
  background: #f8fbff;
}

.button--outline {
  min-height: 38px;
  color: var(--teal-700);
  border-color: #7bcac7;
  background: #fff;
  font-size: 12px;
}

.button--full {
  width: 100%;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.summary-card {
  display: grid;
  min-height: 106px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-card__icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 50%;
}

.summary-card__icon .icon {
  width: 23px;
  height: 23px;
  stroke-width: 2.1;
}

.summary-card__icon--danger {
  color: #e53e4b;
  background: #ffe8ea;
}

.summary-card__icon--warning {
  color: #f07d22;
  background: #fff1df;
}

.summary-card__icon--info {
  color: #1f6ff0;
  background: #e7f1ff;
}

.summary-card__icon--purple {
  color: #8158e8;
  background: #f1eaff;
}

.summary-card__copy {
  align-self: center;
}

.summary-card h2 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.summary-card strong {
  color: var(--navy-950);
  font-size: 25px;
  line-height: 1;
}

.text-action {
  padding: 5px 2px;
  border: 0;
  color: var(--blue-600);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.text-action:hover {
  color: #0e51c1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding: 18px;
}

.dashboard-start__copy {
  flex: 1 1 360px;
}

.dashboard-start h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 18px;
}

.dashboard-start p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.dashboard-start__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-start__actions .button {
  padding: 0 12px;
  font-size: 14px;
}

.dashboard-grid--primary,
.dashboard-grid--secondary {
  grid-template-columns: minmax(0, 1.55fr) minmax(350px, 1fr);
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel__header {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
}

.panel__header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
}

.count-pill {
  display: inline-grid;
  min-width: 24px;
  height: 22px;
  margin-left: 6px;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--text);
  background: #f0f3f8;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}

.task-table,
.contacts-table {
  padding: 0 14px 12px;
}

.task-table__header,
.task-table__row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 68px 66px 66px;
  align-items: center;
  column-gap: 11px;
}

.task-table__header,
.contacts-table__header {
  min-height: 37px;
  padding: 0 12px;
  border: 1px solid #e8ecf3;
  border-radius: 6px;
  color: #53617f;
  background: #fafbfc;
  font-size: 11px;
  font-weight: 700;
}

.task-table__row {
  min-height: 54px;
  padding: 6px 12px;
  border-bottom: 1px solid #edf0f5;
  color: var(--text);
  font-size: 11.5px;
}

.task-table__row:last-child {
  border-bottom: 0;
}

.contact-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.row-check {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 1.5px solid #b8c3d5;
  border-radius: 3px;
  background: #fff;
}

.avatar {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 0 0 1px #e0e6ef;
  font-size: 9px;
  font-weight: 800;
}

.avatar--teal {
  background: linear-gradient(145deg, #22bcb4, #087c84);
}

.avatar--amber {
  background: linear-gradient(145deg, #eab867, #9b6532);
}

.avatar--purple {
  background: linear-gradient(145deg, #9f8ae5, #525a94);
}

.avatar--navy {
  background: linear-gradient(145deg, #3e6ba4, #183657);
}

.avatar--rose {
  background: linear-gradient(145deg, #e68e9d, #965360);
}

.avatar--blue {
  background: linear-gradient(145deg, #62a6e8, #2b5c99);
}

.contact-cell__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.contact-cell strong,
.upcoming-task strong {
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-cell small {
  color: var(--muted);
  font-size: 10px;
}

.task-description,
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.badge--teal {
  color: #087c7a;
  background: #dff5f3;
}

.badge--blue {
  color: #1b68d6;
  background: #e6f0ff;
}

.badge--purple {
  color: #7752d7;
  background: #eee8ff;
}

.badge--orange {
  color: #cc761c;
  background: #fff0dc;
}

.badge--priority-high {
  color: #dc394a;
  background: #ffe5e8;
}

.badge--priority-medium {
  color: #dc781c;
  background: #fff0dd;
}

.badge--priority-low {
  color: #2c6fc8;
  background: #e6f0ff;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.row-actions form {
  margin: 0;
}

.small-icon-button {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border: 1px solid #dde4ee;
  border-radius: 6px;
  color: var(--navy-800);
  background: #fff;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.small-icon-button:hover {
  color: var(--blue-600);
  border-color: #a8c5ef;
  background: #f7fbff;
}

.small-icon-button .icon {
  width: 14px;
  height: 14px;
}

.small-icon-button--blue {
  color: var(--blue-600);
}

.upcoming-panel {
  padding-bottom: 9px;
}

.upcoming-groups {
  padding: 0 16px;
}

.upcoming-group h3 {
  display: flex;
  min-height: 34px;
  align-items: center;
  margin: 0;
  border-bottom: 1px solid #e8edf4;
  color: var(--ink);
  font-size: 11.5px;
}

.upcoming-task {
  display: grid;
  min-height: 35px;
  grid-template-columns: minmax(0, 1fr) 57px 54px;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 10.5px;
}

.upcoming-task > .contact-link {
  min-width: 0;
}

.upcoming-task strong {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}

.upcoming-task > span:not(.badge) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-task time {
  color: var(--ink);
  white-space: nowrap;
}

.upcoming-task .badge {
  justify-self: end;
}

.contacts-table__header,
.contacts-table__row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 42px minmax(0, 0.85fr) minmax(0, 1.1fr) minmax(0, 0.9fr) 82px;
  align-items: center;
  column-gap: 10px;
}

.contacts-table__row {
  min-height: 44px;
  padding: 5px 12px;
  border-bottom: 1px solid #edf0f5;
  font-size: 10.5px;
}

.contacts-table__row:last-child {
  border-bottom: 0;
}

.task-table__header > *,
.contacts-table__header > *,
.task-table__row > *,
.contacts-table__row > * {
  min-width: 0;
}

.task-table__header > *,
.contacts-table__header > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contacts-table__row > :nth-child(2),
.contacts-table__row > :nth-child(3),
.contacts-table__row > :nth-child(5) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-cell--compact {
  gap: 8px;
}

.contact-cell--compact .avatar {
  width: 27px;
  height: 27px;
  font-size: 8px;
}

.contacts-table .small-icon-button {
  width: 24px;
  height: 24px;
}

.contacts-table .row-actions {
  gap: 4px;
}

.text-action--with-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.text-action--with-icon .icon {
  width: 15px;
  height: 15px;
}

.notes-list {
  display: grid;
  gap: 9px;
  padding: 2px 17px 0;
}

.quick-note {
  min-height: 48px;
  padding: 14px 14px;
  border-radius: 7px;
  color: #36466b;
  font-size: 11px;
  line-height: 1.55;
}

.quick-note--yellow {
  background: linear-gradient(105deg, #fff7df, #fff1c7);
}

.quick-note--blue {
  background: linear-gradient(105deg, #edf6ff, #e3f0fd);
}

.quick-note--green {
  background: linear-gradient(105deg, #edf9e9, #e3f4df);
}

.notes-panel__footer {
  margin: 12px 17px 14px;
}

.mock-data-notice {
  margin: 6px 2px 0;
  color: #8b96aa;
  font-size: 11px;
  text-align: right;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 4px 22px;
}

.page-heading--compact {
  margin-bottom: 18px;
}

.contact-heading-actions {
  max-width: 390px;
}

.contact-heading-actions__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.contact-heading-actions__buttons .button {
  flex: 1 1 auto;
}

.contact-heading-actions p {
  font-size: 12px;
}

.page-heading h1 {
  margin: 2px 0 7px;
  color: var(--ink);
  font-size: 27px;
  letter-spacing: -0.55px;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
}

.page-heading .eyebrow {
  color: var(--teal-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.page-breadcrumb {
  display: flex;
  gap: 8px;
  margin: 0 4px 12px;
  color: var(--muted);
  font-size: 12px;
}

.page-breadcrumb a {
  color: var(--blue-600);
  text-decoration: none;
}

.contacts-workspace {
  overflow: hidden;
}

.contact-filters {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 160px 160px auto auto;
  align-items: end;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.contact-filters > div:not(.filter-search) {
  display: grid;
  gap: 6px;
}

.contact-filters label,
.form-field label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.filter-search {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #fff;
}

.filter-search .icon {
  width: 18px;
  color: var(--muted);
}

.filter-search input {
  width: 100%;
  border: 0;
  outline: 0;
}

.contact-filters select,
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.contact-filters select:focus,
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #79aaf4;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(29, 108, 242, 0.1);
}

.contacts-list-header {
  display: flex;
  min-height: 55px;
  align-items: center;
  padding: 0 20px;
}

.contacts-list-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.crm-table {
  overflow-x: auto;
  padding: 0 18px 18px;
}

.crm-table__header,
.crm-table__row {
  display: grid;
  min-width: 980px;
  grid-template-columns: minmax(155px, 1.3fr) 74px 76px minmax(108px, 0.9fr) minmax(165px, 1.25fr) 100px 100px 70px;
  align-items: center;
  gap: 12px;
}

.crm-table__header {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid #e7ebf2;
  border-radius: 7px;
  color: #53617f;
  background: #fafbfc;
  font-size: 11px;
  font-weight: 750;
}

.crm-table__row {
  min-height: 62px;
  padding: 7px 13px;
  border-bottom: 1px solid #edf0f5;
  font-size: 12px;
}

.contact-link {
  color: var(--ink);
  text-decoration: none;
}

.contact-link:hover strong {
  color: var(--blue-600);
}

.status-badge {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
}

.status-badge--active {
  color: #087c66;
  background: #dff5ed;
}

.status-badge--nurture {
  color: #94620b;
  background: #fff1d1;
}

.status-badge--closed {
  color: #4f62a3;
  background: #e8edff;
}

.status-badge--inactive {
  color: #667085;
  background: #eceff3;
}

.empty-state {
  display: grid;
  min-height: 340px;
  place-items: center;
  align-content: center;
  padding: 40px;
  text-align: center;
}

.empty-state__icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  color: var(--teal-700);
  background: var(--teal-100);
}

.empty-state h2 {
  margin: 16px 0 7px;
  color: var(--ink);
  font-size: 18px;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--muted);
}

.contact-form {
  max-width: 980px;
}

.form-section {
  padding: 0 24px 24px;
}

.form-section__heading {
  padding: 21px 0 17px;
  border-bottom: 1px solid var(--line);
}

.form-section__heading h2,
.detail-card h2 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 16px;
}

.form-section__heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding-top: 21px;
}

.form-field {
  display: grid;
  align-content: start;
  gap: 7px;
}

.form-field--wide {
  grid-column: 1 / -1;
}

.form-field label > span {
  color: #d73348;
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

.form-field input:disabled {
  color: #667085;
  background: #f1f3f6;
}

.form-field small {
  color: var(--muted);
  font-size: 11px;
}

.form-field > span,
.field-validation-error {
  color: #c9273d;
  font-size: 11px;
}

.input-validation-error {
  border-color: #e26878 !important;
}

.validation-summary {
  margin-bottom: 14px;
  color: #b42336;
}

.validation-summary:empty {
  display: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 18px;
}

.form-actions--floating {
  position: fixed;
  z-index: 10;
  bottom: 18px;
  left: calc(var(--sidebar-width) + 28px);
  width: min(980px, calc(100vw - var(--sidebar-width) - 56px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(19, 44, 81, 0.14);
  backdrop-filter: blur(10px);
}

.success-banner {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid #a9dfca;
  border-radius: 8px;
  color: #176348;
  background: #eaf8f2;
  font-weight: 650;
}

.tasks-workspace {
  overflow: hidden;
}

.task-tabs {
  display: flex;
  min-height: 59px;
  align-items: end;
  gap: 5px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.task-tab {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 7px;
  padding: 5px 14px 3px;
  border-bottom: 3px solid transparent;
  color: #5d6980;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.task-tab:hover {
  color: var(--blue-600);
}

.task-tab--active {
  border-bottom-color: var(--blue-600);
  color: var(--blue-600);
}

.task-tab > span {
  display: inline-grid;
  min-width: 22px;
  height: 21px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  color: #5b6680;
  background: #edf1f6;
  font-size: 10px;
}

.task-tab--overdue {
  color: #bd2d42;
}

.task-tab--overdue.task-tab--active {
  border-bottom-color: #d64255;
  color: #bd2d42;
}

.task-tab--overdue > span {
  color: #bd2d42;
  background: #ffe7ea;
}

.task-filters {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) auto auto;
  align-items: end;
  gap: 12px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.task-filters > div {
  display: grid;
  gap: 6px;
}

.task-filters label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.task-filters select,
.task-filters input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.task-filters select:focus,
.task-filters input:focus {
  border-color: #79aaf4;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(29, 108, 242, 0.1);
}

.tasks-list-header {
  display: flex;
  min-height: 57px;
  align-items: center;
  padding: 0 20px;
}

.tasks-list-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  text-transform: capitalize;
}

.task-list {
  overflow-x: auto;
  padding: 0 18px 18px;
}

.task-list__header,
.task-list__row {
  display: grid;
  min-width: 780px;
  grid-template-columns: 42px minmax(260px, 1.8fr) minmax(155px, 1fr) 75px 94px 72px;
  align-items: center;
  gap: 12px;
}

.task-list__header {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid #e7ebf2;
  border-radius: 7px;
  color: #53617f;
  background: #fafbfc;
  font-size: 11px;
  font-weight: 750;
}

.task-list__row {
  position: relative;
  min-height: 74px;
  padding: 8px 13px;
  border-bottom: 1px solid #edf0f5;
  color: var(--text);
  font-size: 12px;
}

.task-list__row--overdue {
  background: linear-gradient(90deg, #fff6f7 0, #fff 28%);
}

.task-list__row--overdue::before {
  position: absolute;
  inset: 11px auto 11px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #df4054;
  content: "";
}

.task-list__row--completed {
  background: #fcfcfd;
}

.task-list__title {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.task-list__title a {
  overflow: hidden;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-list__title a:hover {
  color: var(--blue-600);
}

.task-list__title small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.completion-button,
.completion-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
}

.completion-button {
  border: 1.5px solid #b9c5d5;
  color: transparent;
  background: #fff;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.completion-button:hover,
.completion-button:focus-visible {
  border-color: #149a85;
  color: #0f806e;
  background: #e7f7f2;
}

.completion-mark {
  color: #fff;
  background: #15917c;
}

.completion-button .icon,
.completion-mark .icon {
  width: 15px;
  height: 15px;
}

.task-due {
  display: grid;
  gap: 3px;
  color: #46536d;
}

.task-due--overdue {
  color: #b3263c;
  font-weight: 700;
}

.overdue-label {
  width: max-content;
  padding: 2px 6px;
  border-radius: 4px;
  color: #b3263c;
  background: #ffe3e7;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge--todo {
  color: #54617a;
  background: #edf0f5;
}

.status-badge--progress {
  color: #94620b;
  background: #fff1d1;
}

.status-badge--completed {
  color: #087c66;
  background: #dff5ed;
}

.small-icon-button--danger {
  color: #ba3044;
}

.small-icon-button--danger:hover {
  border-color: #e7a7b0;
  color: #a91f34;
  background: #fff6f7;
}

.contact-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 23px 25px;
}

.contact-hero__identity,
.contact-hero__actions,
.contact-hero__badges {
  display: flex;
  align-items: center;
}

.contact-hero__identity {
  gap: 16px;
}

.contact-hero__avatar {
  width: 62px;
  height: 62px;
  font-size: 17px;
}

.contact-hero__badges {
  gap: 7px;
  margin-bottom: 6px;
}

.contact-hero h1 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 25px;
}

.contact-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.contact-hero__actions {
  gap: 10px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.detail-card {
  padding: 0 22px 20px;
}

.detail-card--wide {
  grid-column: 1 / -1;
}

.detail-card__header {
  padding: 19px 0 14px;
  border-bottom: 1px solid var(--line);
}

.detail-list {
  margin: 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 155px 1fr;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid #edf0f5;
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}

.contact-notes {
  margin: 17px 0 0;
  color: var(--text);
  line-height: 1.75;
  white-space: pre-wrap;
}

.contact-tasks-empty {
  margin: 17px 0 0;
  color: var(--muted);
}

.contact-tasks {
  display: grid;
}

.contact-tasks__item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, auto) auto auto;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #edf0f5;
}

.contact-tasks__item:last-child {
  border-bottom: 0;
}

.contact-tasks__title {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.contact-tasks__title:hover {
  color: var(--teal);
  text-decoration: underline;
}

.contact-tasks__due {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.contact-opportunities-empty {
  margin: 17px 0 0;
  color: var(--muted);
}

.contact-opportunities {
  display: grid;
}

.contact-opportunities__item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  gap: 12px 20px;
  padding: 13px 0;
  border-bottom: 1px solid #edf0f5;
}

.contact-opportunities__item:last-child {
  border-bottom: 0;
}

.contact-opportunities__title {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.contact-opportunities__title:hover {
  color: var(--teal);
  text-decoration: underline;
}

.contact-opportunities__facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 7px 10px;
  color: var(--muted);
  font-size: 12px;
}

.contact-email { min-width: 0; width: 100%; overflow-wrap: anywhere; }
.contact-email summary { cursor: pointer; }
.contact-email summary .badge { margin-right: 8px; }
.contact-email__participants { margin: 16px 0; font-size: 13px; }
.contact-email__participants div { display: flex; gap: 12px; margin: 4px 0; }
.contact-email__participants dt { flex: 0 0 100px; font-weight: 600; }
.contact-email__participants dd { margin: 0; min-width: 0; }
.contact-email__body { width: 100%; height: 320px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.contact-email__attachments { padding-left: 20px; font-size: 13px; }
.contact-email__attachments li { margin: 6px 0; }
@media (max-width: 640px) {
  .contact-activity .contact-activity__item { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

.contact-activity-empty {
  margin: 17px 0 0;
  color: var(--muted);
}

.contact-activity {
  display: grid;
}

.contact-activity__item {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid #edf0f5;
}

.contact-activity__item:last-child {
  border-bottom: 0;
}

.contact-activity__time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.contact-activity__description {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

a.contact-activity__description:hover {
  color: var(--teal);
  text-decoration: underline;
}

@media (max-width: 1240px) {
  :root {
    --sidebar-width: 210px;
  }

  .sidebar {
    padding-inline: 14px;
  }

  .brand {
    margin-left: 7px;
  }

  .brand__ree {
    font-size: 21px;
  }

  .brand__crm {
    font-size: 19px;
  }

  .main-content {
    padding-inline: 20px;
  }

  .form-actions--floating {
    left: calc(var(--sidebar-width) + 20px);
    width: min(980px, calc(100vw - var(--sidebar-width) - 40px));
  }

  .summary-card {
    gap: 10px;
    padding-inline: 13px;
  }

  .summary-card__icon {
    width: 44px;
    height: 44px;
  }

  .dashboard-grid--primary,
  .dashboard-grid--secondary {
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
  }

}

@media (max-width: 1050px) {
  .profile__copy {
    display: none;
  }

  .profile {
    padding-left: 12px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid--primary,
  .dashboard-grid--secondary {
    grid-template-columns: 1fr;
  }

  .upcoming-task {
    grid-template-columns: minmax(0, 1fr) 65px 60px;
  }

  .task-tabs {
    overflow-x: auto;
  }

  .task-tab {
    white-space: nowrap;
  }

  .task-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 0px;
  }

  html {
    background: #fff;
  }

  body {
    min-width: 0;
    background: #fff;
    font-size: 14px;
  }

  .app-shell {
    display: block;
    min-height: 100dvh;
  }

  .sidebar,
  .top-header,
  .desktop-dashboard {
    display: none;
  }

  .app-workspace {
    min-width: 0;
  }

  .main-content {
    min-height: 100dvh;
    padding: 18px 16px calc(102px + env(safe-area-inset-bottom));
  }

  .mobile-dashboard {
    display: block;
    max-width: 600px;
    margin: 0 auto;
  }

  .mobile-home-header {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 2px 7px;
  }

  .mobile-brand {
    display: flex;
    align-items: baseline;
    gap: 5px;
    color: var(--navy-950);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.8px;
    text-decoration: none;
    white-space: nowrap;
  }

  .mobile-brand__accent {
    color: #168ad3;
  }

  .mobile-brand strong {
    color: var(--teal-700);
    font-size: 18px;
  }

  .mobile-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: 12px;
    white-space: nowrap;
  }

  .mobile-profile__avatar {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #17427b, #071d4f);
    font-size: 13px;
    font-weight: 750;
  }

  .mobile-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 23px;
  }

  .mobile-quick-actions a {
    display: flex;
    min-width: 0;
    min-height: 64px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 7px;
    border: 1px solid #d9e1ed;
    border-radius: 9px;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 2px 7px rgba(17, 42, 91, 0.035);
    font-size: 12px;
    font-weight: 720;
    text-align: center;
    text-decoration: none;
  }

  .mobile-quick-actions a > span {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #159ba4, #007e91);
  }

  .mobile-quick-actions .icon {
    width: 20px;
    height: 20px;
  }

  .mobile-success-banner {
    margin: -8px 0 18px;
  }

  .mobile-home-section {
    margin-bottom: 22px;
  }

  .mobile-section-heading {
    display: flex;
    min-height: 37px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .mobile-section-heading h2 {
    margin: 0;
    color: var(--ink);
    font-size: 22px;
    font-weight: 720;
    letter-spacing: -0.45px;
  }

  .mobile-section-heading a {
    min-height: 44px;
    padding: 13px 2px 0 12px;
    color: var(--blue-600);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
  }

  .mobile-list {
    overflow: hidden;
    border: 1px solid #d9e1ed;
    border-radius: 9px;
    background: #fff;
  }

  .mobile-today-task,
  .mobile-upcoming-row,
  .mobile-contact-row,
  .mobile-note-row {
    position: relative;
    display: grid;
    min-height: 63px;
    align-items: center;
    border-bottom: 1px solid #e6ebf2;
    color: var(--text);
    text-decoration: none;
  }

  .mobile-today-task:last-child,
  .mobile-upcoming-row:last-child,
  .mobile-contact-row:last-child,
  .mobile-note-row:last-child {
    border-bottom: 0;
  }

  .mobile-today-task {
    grid-template-columns: 42px 72px minmax(0, 1fr) 36px;
    gap: 7px;
    padding: 7px 9px;
  }

  .mobile-today-task form {
    margin: 0;
  }

  .mobile-today-task form button {
    display: block;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1.5px solid #607397;
    border-radius: 50%;
    background: #fff;
  }

  .mobile-today-task form button:active {
    border-color: var(--teal-700);
    background: var(--teal-100);
  }

  .mobile-today-task > time {
    color: #0868d8;
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
  }

  .mobile-overdue-section .mobile-section-heading h2 {
    color: #a52a23;
  }

  .mobile-overdue-section .mobile-list {
    border-color: #e6aaa5;
  }

  .mobile-task-hint {
    margin: 0 0 9px;
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-today-task--overdue {
    background: #fff5f3;
  }

  .mobile-today-task--overdue > time {
    color: #a52a23;
    white-space: normal;
  }

  .mobile-today-task__copy,
  .mobile-upcoming-row__copy,
  .mobile-contact-row__copy,
  .mobile-note-row__copy {
    display: grid;
    min-width: 0;
    gap: 4px;
    color: var(--ink);
    text-decoration: none;
  }

  .mobile-today-task__copy strong,
  .mobile-upcoming-row__copy strong,
  .mobile-contact-row__copy strong,
  .mobile-note-row__copy strong {
    overflow: hidden;
    font-size: 14px;
    font-weight: 720;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-today-task__copy span,
  .mobile-upcoming-row__copy small,
  .mobile-contact-row__copy small,
  .mobile-note-row__copy small {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-today-task__copy .icon,
  .mobile-upcoming-row__copy .icon,
  .mobile-contact-row__copy .icon {
    width: 14px;
    height: 14px;
  }

  .mobile-row-icon {
    display: grid;
    width: 36px;
    height: 44px;
    place-items: center;
    color: #f46a1b;
  }

  .mobile-row-icon .icon {
    width: 21px;
    height: 21px;
  }

  .mobile-upcoming-row {
    grid-template-columns: 43px 82px minmax(0, 1fr) 22px;
    gap: 7px;
    padding: 7px 10px;
  }

  .mobile-row-symbol {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    color: #007e98;
    background: #eef8fa;
  }

  .mobile-row-symbol .icon {
    width: 20px;
    height: 20px;
  }

  .mobile-upcoming-row > time {
    overflow: hidden;
    color: #00869b;
    font-size: 12px;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-chevron {
    color: #476080;
    font-size: 27px;
    font-weight: 300;
    line-height: 1;
  }

  .mobile-contact-row {
    grid-template-columns: 48px minmax(0, 1fr) 22px;
    gap: 8px;
    padding: 7px 10px;
  }

  .mobile-contact-row .avatar {
    width: 42px;
    height: 42px;
    font-size: 11px;
  }

  .mobile-contact-row__copy small b {
    font-size: 8px;
  }

  .mobile-note-row {
    grid-template-columns: 43px minmax(0, 1fr) auto 18px;
    gap: 8px;
    padding: 7px 10px;
  }

  .mobile-note-row > time {
    color: var(--muted);
    font-size: 10.5px;
    white-space: nowrap;
  }

  .mobile-empty-state {
    display: grid;
    min-height: 132px;
    place-items: center;
    align-content: center;
    gap: 6px;
    padding: 18px;
    text-align: center;
  }

  .mobile-empty-state > span {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    color: var(--teal-700);
    background: var(--teal-100);
  }

  .mobile-empty-state p {
    margin: 0;
    color: var(--muted);
  }

  .mobile-empty-state a {
    min-height: 44px;
    padding: 12px;
    color: var(--blue-600);
    font-weight: 700;
    text-decoration: none;
  }

  .mobile-empty-state--compact {
    min-height: 92px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 80;
    inset: auto 0 0;
    display: grid;
    min-height: calc(72px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    padding: 7px 6px env(safe-area-inset-bottom);
    border-top: 1px solid #d9e1ed;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -5px 18px rgba(17, 42, 91, 0.06);
    backdrop-filter: blur(14px);
  }

  .mobile-nav__item {
    display: flex;
    min-width: 0;
    min-height: 58px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    color: #53617d;
    font-size: 10px;
    text-decoration: none;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
  }

  .mobile-nav__item > .icon {
    width: 23px;
    height: 23px;
  }

  .mobile-nav__item--active {
    color: #0089a0;
    font-weight: 750;
    background: var(--teal-100);
  }

  .mobile-nav__item--tasks {
    transform: translateY(-25px);
  }

  .mobile-nav__task-icon {
    display: grid;
    width: min(58px, 100%);
    aspect-ratio: 1;
    place-items: center;
    border: 5px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #18a2ae, #007b95);
    box-shadow: 0 0 0 1px #d9e1ed, 0 7px 15px rgba(0, 126, 145, 0.24);
  }

  .mobile-nav__task-icon .icon {
    width: 25px;
    height: 25px;
  }

  .page-heading,
  .dashboard-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
    margin: 0 0 17px;
  }

  .page-heading h1 {
    margin-top: 0;
    font-size: 25px;
  }

  .page-heading > .button,
  .page-heading > div + .button {
    width: 100%;
  }

  .page-heading--compact {
    margin-bottom: 14px;
  }

  .page-breadcrumb {
    min-height: 44px;
    align-items: center;
    margin: -8px 0 5px;
    font-size: 12px;
  }

  .page-breadcrumb a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    font-weight: 700;
  }

  .page-breadcrumb a::before {
    margin-right: 5px;
    content: "‹";
    font-size: 22px;
    line-height: 1;
  }

  .panel {
    border-radius: 10px;
  }

  .contact-filters,
  .task-filters {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 14px;
  }

  .contact-filters .button,
  .task-filters .button {
    width: 100%;
  }

  .contacts-list-header,
  .tasks-list-header {
    min-height: 51px;
    padding-inline: 14px;
  }

  .crm-table,
  .task-list {
    overflow: visible;
    padding: 0 12px 14px;
  }

  .crm-table__header,
  .task-list__header {
    display: none;
  }

  .crm-table__row {
    position: relative;
    min-width: 0;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    margin-bottom: 10px;
    padding: 13px;
    border: 1px solid #e2e7ef;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(17, 42, 91, 0.035);
  }

  .crm-table__row > :first-child {
    grid-column: 1;
    grid-row: 1;
    min-height: 44px;
  }

  .crm-table__row > :nth-child(2),
  .crm-table__row > :nth-child(3) {
    align-self: center;
    grid-column: 1;
    font-size: 11px;
  }

  .crm-table__row > :nth-child(4),
  .crm-table__row > :nth-child(5) {
    grid-column: 1 / -1;
    min-height: 30px;
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .crm-table__row > :nth-child(4)::before {
    margin-right: 7px;
    color: var(--muted);
    content: "Phone";
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .crm-table__row > :nth-child(5)::before {
    margin-right: 7px;
    color: var(--muted);
    content: "Email";
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .crm-table__row > :nth-child(6),
  .crm-table__row > :nth-child(7) {
    display: none;
  }

  .crm-table__row > .row-actions {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: start;
  }

  .small-icon-button {
    width: 44px;
    height: 44px;
  }

  .small-icon-button .icon {
    width: 18px;
    height: 18px;
  }

  .task-tabs {
    min-height: 57px;
    align-items: end;
    padding-inline: 10px;
    scrollbar-width: none;
  }

  .task-tabs::-webkit-scrollbar {
    display: none;
  }

  .task-tab {
    min-height: 45px;
    padding-inline: 11px;
  }

  .task-list__row {
    min-width: 0;
    min-height: 0;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 7px 9px;
    margin-bottom: 10px;
    padding: 13px 10px;
    border: 1px solid #e2e7ef;
    border-radius: 9px;
    background: #fff;
  }

  .task-list__row > :first-child {
    grid-column: 1;
    grid-row: 1 / span 3;
  }

  .completion-button,
  .completion-mark {
    width: 34px;
    height: 34px;
  }

  .task-list__title {
    grid-column: 2;
    grid-row: 1;
    min-height: 34px;
  }

  .task-list__title a {
    font-size: 14px;
  }

  .task-due {
    grid-column: 2;
    grid-row: 2;
    font-size: 11px;
  }

  .task-list__row > :nth-child(4),
  .task-list__row > :nth-child(5) {
    display: none;
  }

  .task-list__row > .row-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: start;
    flex-direction: column;
  }

  .contact-form {
    max-width: none;
  }

  .form-section {
    padding: 0 16px 18px;
  }

  .form-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .contact-tasks__item {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
  }

  .contact-tasks__due {
    grid-column: 1;
    grid-row: 2;
  }

  .contact-opportunities__item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .contact-opportunities__facts {
    justify-content: flex-start;
  }

  .form-field--wide,
  .detail-card--wide {
    grid-column: auto;
  }

  .form-field input,
  .form-field select,
  .form-field textarea {
    min-height: 48px;
    font-size: 16px;
  }

  .form-actions {
    position: sticky;
    z-index: 5;
    bottom: calc(72px + env(safe-area-inset-bottom));
    margin: 12px -16px -12px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
  }

  .form-actions--floating {
    position: sticky;
    left: auto;
    width: auto;
    border-inline: 0;
    border-bottom: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .form-actions .button {
    min-height: 48px;
    flex: 1;
  }

  .contact-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .contact-hero__identity {
    align-items: flex-start;
  }

  .contact-hero__avatar {
    width: 54px;
    height: 54px;
  }

  .contact-hero h1 {
    font-size: 22px;
  }

  .contact-hero__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-hero__actions .button {
    min-width: 0;
    padding-inline: 11px;
  }

  .detail-card {
    padding-inline: 16px;
  }

  .detail-list > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .detail-card__header--with-action {
    align-items: flex-start;
  }

  .empty-state {
    min-height: 250px;
    padding: 28px 18px;
  }

  .account-heading {
    margin-top: 4px;
  }

  .account-grid {
    max-width: 600px;
    grid-template-columns: minmax(0, 1fr);
    margin: 0 auto;
  }

  .account-card {
    padding: 19px;
  }

  .copy-field {
    grid-template-columns: minmax(0, 1fr);
  }

  .copy-field input {
    font-size: 12px;
  }

  .copy-button {
    width: 100%;
  }
}

@media (max-width: 370px) {
  .main-content {
    padding-inline: 12px;
  }

  .task-form > .form-actions {
    margin-inline: -12px;
  }

  .mobile-profile > span:first-child {
    display: none;
  }

  .mobile-quick-actions a {
    flex-direction: column;
    gap: 5px;
    font-size: 11px;
  }

  .mobile-today-task {
    grid-template-columns: 38px 65px minmax(0, 1fr) 32px;
    gap: 4px;
    padding-inline: 7px;
  }

  .mobile-upcoming-row {
    grid-template-columns: 39px 69px minmax(0, 1fr) 18px;
    gap: 5px;
    padding-inline: 7px;
  }
}

@media (max-width: 760px) {
  .mobile-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(72px + env(safe-area-inset-bottom));
  }

  .mobile-nav__item--tasks {
    transform: none;
  }

  .mobile-nav__task-icon {
    width: 28px;
    height: 28px;
    border-width: 2px;
  }

  .mobile-nav__task-icon .icon {
    width: 20px;
    height: 20px;
  }

  .main-content {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .form-actions {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

/* One-row mobile navigation with the remaining destinations in a keyboard-accessible dialog. */
.mobile-more { width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 110px - env(safe-area-inset-bottom)); margin: auto auto calc(84px + env(safe-area-inset-bottom)); padding: 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: #fff; box-shadow: var(--shadow); }
.mobile-more::backdrop { background: rgba(7, 29, 79, .35); }
.mobile-more__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.mobile-more__header h2 { margin: 0; color: var(--ink); font-size: 18px; }
.mobile-more form { margin: 0; }
.mobile-more nav { display: grid; gap: 4px; }
.mobile-more .nav-link { min-height: 48px; }
.mobile-more__logout { padding-top: 12px; }
body:has(.mobile-more[open]) { overflow: hidden; }
@media (max-width: 760px) {
  html { scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* Captured email uses the existing address copy control and protected body viewer. */
.saved-email-heading > div { min-width: 0; }
.environment-indicator { margin: 0 0 12px; color: var(--muted); font-size: 12px; font-weight: 600; }
.saved-email-list { list-style: none; margin: 0; padding: 0 24px; }
.saved-email-list li { display: grid; gap: 8px; padding: 16px 0; overflow-wrap: anywhere; }
.saved-email-list li + li { border-top: 1px solid #e4e9f1; }
.saved-email-subject { font-weight: 650; color: #173e68; }
.saved-email-sender { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.saved-email-list time, .saved-email-unmatched { color: #53617d; font-size: 13px; }
.saved-email-contacts { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.saved-email-help { padding: 16px 24px; margin-bottom: 20px; }
.saved-email-help summary { cursor: pointer; font-weight: 650; }
.saved-email-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 20px 24px; }
.saved-email-heading h1, .saved-email-detail { overflow-wrap: anywhere; }
.saved-email-detail h2 { margin-top: 24px; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Bounded contact import: wrap source text and keep decisions usable at narrow widths. */
.contact-import { display: grid; gap: 20px; min-width: 0; }
.contact-import .import-section { padding: clamp(16px, 3vw, 28px); min-width: 0; }
.contact-import p, .import-row, .import-mapping label { overflow-wrap: anywhere; }
.import-mapping, .import-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.import-mapping > div, .import-values > div { min-width: 0; }
.import-mapping label, .contact-import label[for='import-file'] { display: block; margin-bottom: 6px; font-weight: 600; }
.import-mapping select, .contact-import input[type='file'] { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; }
.contact-import button, .contact-import .button { margin-top: 14px; white-space: normal; }
.import-counts { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-block: 20px; }
.import-counts strong { display: block; font-size: 1.6rem; }
.import-warning { padding: 14px; border-left: 4px solid #b7791f; background: #fff8e8; color: #573c14; }
.import-row { border-top: 1px solid #dce3e9; margin-top: 22px; padding-top: 18px; }
.import-row h3 { font-size: 1.05rem; }
.import-values { margin-block: 12px; font-size: .9rem; }
.import-values dt { color: #5b6571; }
.import-values dd { margin: 3px 0 0; white-space: pre-wrap; }
.import-row ul { padding-left: 20px; }
.import-decision { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.import-decision input { flex: 0 0 20px; width: 20px; height: 20px; }
.contact-import summary { cursor: pointer; padding-block: 12px; }
