:root {
  --ink: #242235;
  --ink-soft: #3a344f;
  --muted: #7e7a8b;
  --line: #dedde5;
  --line-soft: #eeeeef;
  --paper: #ffffff;
  --page: #eeeeea;
  --purple: #302a45;
  --purple-2: #464061;
  --accent: #7566c8;
  --accent-soft: #ebe8ff;
  --green: #8ab98b;
  --red: #ef6674;
  --yellow: #f2bf62;
  --blue: #a7d6dd;
  --shadow: 0 18px 48px rgba(35, 33, 52, .1);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

body.modal-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border .15s ease, box-shadow .15s ease, background .15s ease;
}

input,
select {
  height: 40px;
  padding: 0 13px;
}

textarea {
  min-height: 104px;
  resize: vertical;
  padding: 12px 13px;
}

select option {
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(117, 102, 200, .13);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  height: 64px;
  display: grid;
  grid-template-columns: 300px minmax(260px, 680px) 1fr;
  gap: 18px;
  align-items: center;
  padding: 0 28px;
  background: #232231;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 12px 26px rgba(24, 22, 34, .18);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  flex: 0 0 auto;
}

.brand-title {
  font-weight: 800;
  letter-spacing: .02em;
}

.brand-subtitle {
  margin-top: 2px;
  color: rgba(255, 255, 255, .55);
  font-size: 12px;
}

.top-search input {
  height: 38px;
  background: #3a354f;
  color: #fff;
  border: 1px solid #514b6f;
}

.top-search input::placeholder {
  color: rgba(255, 255, 255, .58);
}

.top-search input:focus {
  box-shadow: 0 0 0 4px rgba(117, 102, 200, .23);
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 20px 88px;
  width: 100%;
}

.left-panel,
.metric-card,
.context-bar,
.filter-card,
.contacts-panel,
.detail-panel,
.profile-card,
.empty-card,
.modal-card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(40, 38, 54, .055);
}

.left-panel {
  position: sticky;
  top: 82px;
  height: calc(100vh - 100px);
  padding: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border-radius: 14px;
  background: #f4f3f1;
}

.mode-tabs button {
  height: 38px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mode-tabs button.active {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 10px 20px rgba(48, 42, 69, .2);
}

.nav-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 8px;
  margin: 12px 0;
}

.sidebar-action {
  height: 40px;
  border: 1px solid #d8d5e9;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--purple);
  font-weight: 850;
  margin-bottom: 10px;
}

.nav-list {
  overflow: auto;
  padding-right: 2px;
}

.nav-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  min-height: 58px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-align: left;
}

.nav-item:hover {
  background: #f7f6f3;
  border-color: #eeeae4;
}

.nav-item.active {
  background: var(--accent-soft);
  border-color: #cbc4ff;
}

.nav-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #eceaf3;
  font-size: 19px;
}

.nav-name {
  display: block;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-count {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.count-pill {
  min-width: 34px;
  border-radius: 999px;
  background: #f0eff4;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  padding: 5px 8px;
}

.main-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 15px 18px;
}

.metric-card span {
  display: block;
  font-size: 25px;
  line-height: 1;
  font-weight: 900;
}

.metric-card small {
  display: block;
  color: var(--muted);
  margin-top: 7px;
  font-size: 12px;
  font-weight: 700;
}

.context-bar {
  min-height: 62px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.context-title {
  font-size: 18px;
  font-weight: 900;
}

.context-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.context-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter-card {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 280px) minmax(130px, 160px) minmax(190px, 240px) minmax(320px, 1.6fr);
  gap: 10px;
  align-items: center;
}

.field-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.field-toggles label {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #f5f4f0;
  border: 1px solid #e8e5dc;
  padding: 0 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.field-toggles input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(520px, 1.35fr) minmax(380px, .85fr);
  gap: 14px;
  align-items: start;
}

.contacts-panel {
  padding: 10px;
  min-height: 560px;
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-card {
  border: 1px solid var(--line-soft);
  background: #fff;
  border-radius: 15px;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  transition: transform .14s ease, border .14s ease, box-shadow .14s ease, background .14s ease;
}

.contact-card:hover {
  transform: translateY(-1px);
  border-color: #d7d2f3;
  box-shadow: 0 12px 28px rgba(48, 42, 69, .08);
}

.contact-card.active {
  background: #fbfaff;
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(117, 102, 200, .16);
}

.contact-card input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--purple);
}

.contact-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.contact-name {
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.contact-sub,
.contact-meta {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.country-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  border-radius: 999px;
  background: #f0eef8;
  color: var(--purple);
  border: 1px solid #e0ddef;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.contact-tags,
.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-badge,
.color-label {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 8px;
  padding: 3px 8px;
  background: #e9f3f5;
  color: #44616a;
  font-size: 11px;
  font-weight: 850;
}

.tag-badge.muted {
  background: #eeeef1;
  color: var(--muted);
}

.tag-badge.warning {
  background: #fff3d9;
  color: #8b6120;
}

.tag-badge.list {
  background: var(--accent-soft);
  color: var(--purple);
}

.contact-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-label.vip,
.color-label.partner {
  background: #dcebdc;
  color: #476f4e;
}

.color-label.hot {
  background: #ffe2e7;
  color: #a33b49;
}

.color-label.followup {
  background: #fff0cf;
  color: #8b6120;
}

.color-label.later {
  background: #e8e7ef;
  color: var(--purple);
}

.detail-panel {
  min-height: 560px;
  position: sticky;
  top: 82px;
  overflow: hidden;
}

.empty-card {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-card.compact {
  box-shadow: none;
  border: 0;
  background: #f7f6f3;
  padding: 16px;
}

.profile-card {
  box-shadow: none;
  border: 0;
  padding: 18px;
}

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

.avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--purple), var(--accent));
  color: #fff;
  font-size: 20px;
  font-weight: 950;
  box-shadow: 0 14px 26px rgba(48, 42, 69, .2);
}

.detail-title {
  font-size: 20px;
  font-weight: 950;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.detail-email,
.detail-muted,
.muted-text {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.profile-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.danger-icon:hover {
  border-color: var(--red);
  color: var(--red);
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.info-row {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8f7f4;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.info-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.info-row strong {
  color: var(--ink);
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

.info-row a {
  color: var(--accent);
  text-decoration: none;
}

.section-block {
  margin-top: 18px;
}

.section-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.notes-box {
  background: #f8f7f4;
  border-radius: 13px;
  min-height: 76px;
  padding: 12px;
  color: var(--ink-soft);
  font-size: 13px;
  white-space: pre-wrap;
}

.detail-actions,
.modal-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
}

.primary-btn,
.dark-btn,
.light-btn,
.ghost-btn,
.danger-btn,
.tiny-btn {
  min-height: 38px;
  border-radius: 12px;
  padding: 0 14px;
  border: 1px solid transparent;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px rgba(117, 102, 200, .25);
}

.primary-btn:hover {
  background: #6959bd;
}

.dark-btn {
  background: var(--purple);
  color: #fff;
}

.light-btn,
.ghost-btn {
  background: #fff;
  color: var(--purple);
  border-color: var(--line);
}

.light-btn:hover,
.ghost-btn:hover {
  border-color: #bdb5ef;
  background: #fbfaff;
}

.danger-btn {
  background: #fff1f3;
  color: #b23745;
  border-color: #ffd0d7;
}

.danger-btn:hover {
  background: #ffe4e8;
}

.tiny-btn {
  min-height: 32px;
  border-radius: 10px;
  background: #f6f5f1;
  color: var(--purple);
  border-color: var(--line);
  font-size: 12px;
}

.load-more {
  width: 100%;
  margin-top: 10px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--purple);
  font-weight: 900;
}

.selection-dock {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 120%);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  min-width: min(980px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(35, 34, 49, .96);
  color: #fff;
  box-shadow: 0 24px 80px rgba(24, 22, 34, .32);
  transition: transform .2s ease, opacity .2s ease;
}

.selection-dock.visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.selection-title {
  font-weight: 950;
  padding-left: 6px;
  white-space: nowrap;
}

.selection-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.selection-actions .light-btn {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-color: rgba(255, 255, 255, .18);
}

.selection-actions .dark-btn {
  background: rgba(255, 255, 255, .14);
}

.modal-host[hidden] {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 19, 30, .58);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-shell {
  width: min(860px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.modal-card {
  padding: 20px;
  box-shadow: var(--shadow);
}

.small-modal-card {
  width: min(520px, 100%);
  margin: 0 auto;
}

.editor-modal-card {
  width: min(860px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 20px;
  font-weight: 950;
}

.modal-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.field label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.custom-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 36px;
  gap: 8px;
  margin-bottom: 8px;
}

.copy-box {
  min-height: 170px;
  width: 100%;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 140;
  background: #232231;
  color: #fff;
  border-radius: 14px;
  padding: 12px 15px;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 18px 42px rgba(24, 22, 34, .24);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform .18s ease, opacity .18s ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1240px) {
  .layout {
    grid-template-columns: 290px minmax(0, 1fr);
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .detail-panel {
    position: static;
  }
  .filter-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .topbar {
    height: auto;
    padding: 12px;
    grid-template-columns: 1fr;
  }
  .top-actions {
    justify-content: flex-start;
  }
  .layout {
    grid-template-columns: 1fr;
    padding: 12px 12px 96px;
  }
  .left-panel {
    position: static;
    height: auto;
    max-height: 420px;
  }
  .metric-row,
  .filter-card,
  .form-row {
    grid-template-columns: 1fr;
  }
  .selection-dock {
    align-items: flex-start;
    flex-direction: column;
  }
  .selection-actions {
    justify-content: flex-start;
  }
}


html,
body {
  height: 100%;
  overflow: hidden;
}

.app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex: 0 0 64px;
  grid-template-columns: 300px minmax(320px, 760px) 1fr;
  justify-content: stretch;
  padding: 0 20px;
}

.top-search {
  min-width: 0;
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 10px;
}

.sidebar-actions .primary-btn,
.sidebar-actions .dark-btn {
  width: 100%;
  min-height: 42px;
}

.layout {
  flex: 1 1 auto;
  height: calc(100vh - 64px);
  min-height: 0;
  overflow: hidden;
  grid-template-columns: 320px minmax(0, 1fr);
  padding: 14px 16px 18px;
}

.left-panel {
  position: static;
  top: auto;
  height: 100%;
  min-height: 0;
}

.nav-tools {
  grid-template-columns: minmax(0, 1fr) 158px;
}

.nav-tools select {
  min-width: 158px;
}

.main-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.metric-row,
.context-bar,
.filter-card {
  flex: 0 0 auto;
}

.metric-row {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.filter-card {
  grid-template-columns: minmax(150px, 1fr) minmax(140px, 160px) minmax(140px, 170px) minmax(190px, 230px) minmax(430px, 1.8fr);
}

.field-toggles label,
.field-toggles input {
  cursor: pointer;
}

.field-toggles label:has(input:checked) {
  background: var(--accent-soft);
  border-color: #c7c0f4;
  color: var(--purple);
}

.workspace {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow: hidden;
  align-items: stretch;
  grid-template-columns: minmax(520px, 1.45fr) minmax(380px, .85fr);
}

.contacts-panel,
.detail-panel {
  min-height: 0;
  height: 100%;
  overscroll-behavior: contain;
}

.contacts-panel {
  overflow-y: auto;
  padding-right: 8px;
}

.detail-panel {
  position: static;
  top: auto;
  overflow-y: auto;
}

.profile-card {
  min-height: 100%;
}

.contacts-panel::-webkit-scrollbar,
.detail-panel::-webkit-scrollbar,
.nav-list::-webkit-scrollbar {
  width: 10px;
}

.contacts-panel::-webkit-scrollbar-thumb,
.detail-panel::-webkit-scrollbar-thumb,
.nav-list::-webkit-scrollbar-thumb {
  background: #d8d5df;
  border-radius: 999px;
  border: 3px solid #fff;
}

@media (max-width: 1240px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
  }

  .layout {
    height: auto;
    overflow: visible;
  }

  .main-panel,
  .workspace,
  .contacts-panel,
  .detail-panel {
    height: auto;
    overflow: visible;
  }
}

.top-link-btn {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-weight: 900;
  padding: 0 14px;
}

.top-link-btn:hover {
  background: rgba(255, 255, 255, .14);
}

.auth-page {
  min-height: 100vh;
  overflow: auto;
  background: radial-gradient(circle at 18% 10%, rgba(117, 102, 200, .2), transparent 30%), var(--page);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(430px, 100%);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-brand {
  margin-bottom: 24px;
  color: var(--ink);
}

.auth-brand .brand-subtitle {
  color: var(--muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.remember-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

.remember-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.auth-submit {
  width: 100%;
  min-height: 44px;
}

.auth-submit:disabled {
  opacity: .7;
  cursor: wait;
}

.auth-error {
  border: 1px solid #ffd0d7;
  background: #fff1f3;
  color: #b23745;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  display: block;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .24));
}

.filter-card {
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 280px) minmax(130px, 160px) minmax(190px, 240px) minmax(430px, 1.8fr);
}

.custom-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .01em;
}

.custom-badge.purple { background: #ebe8ff; color: #463c8f; }
.custom-badge.blue { background: #e5f1ff; color: #285b91; }
.custom-badge.green { background: #e4f3e4; color: #3f7445; }
.custom-badge.yellow { background: #fff2ce; color: #8a6119; }
.custom-badge.red { background: #ffe5ea; color: #a73748; }
.custom-badge.gray { background: #ececf1; color: #555264; }
.custom-badge.pink { background: #ffe5f2; color: #a33170; }
.custom-badge.teal { background: #ddf4f1; color: #31736c; }

.custom-badge-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) 140px 36px;
  gap: 8px;
  margin-bottom: 8px;
}

.import-drop {
  position: relative;
  border: 1.5px dashed #c8c1f1;
  background: linear-gradient(180deg, #fbfaff, #f6f4ff);
  border-radius: 18px;
  padding: 28px;
  text-align: center;
  overflow: hidden;
}

.import-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  height: 100%;
}

.import-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  background: var(--purple);
  color: #fff;
  font-size: 26px;
  font-weight: 950;
}

.import-title {
  font-size: 17px;
  font-weight: 950;
}

.import-subtitle {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.import-result {
  margin-top: 14px;
  border-radius: 14px;
  background: #e9f5ea;
  color: #3f7445;
  padding: 12px;
  font-weight: 800;
}

.admin-modal-card {
  width: min(1100px, 100%);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(360px, .86fr) minmax(420px, 1.14fr);
  gap: 16px;
  align-items: start;
}

.admin-section {
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 14px;
  background: #fbfaf7;
}

.account-card {
  border: 1px solid #ece8dd;
  background: #fff;
  border-radius: 15px;
  padding: 12px;
  margin-bottom: 10px;
}

.account-title {
  font-weight: 950;
  margin-bottom: 10px;
}

.logs-list {
  max-height: 520px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.log-row {
  border: 1px solid #eee9df;
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
}

.log-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.log-main strong {
  color: var(--purple);
  font-size: 13px;
}

.log-main span {
  color: var(--ink-soft);
  font-size: 12px;
  text-align: right;
}

.log-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.log-details {
  margin-top: 10px;
  display: grid;
  gap: 9px;
}

.log-contact,
.log-contact-chip,
.log-block,
.log-mini-grid {
  border: 1px solid #eee9df;
  background: #fbfaf7;
  border-radius: 12px;
}

.log-contact,
.log-contact-chip {
  padding: 8px 10px;
}

.log-contact-title {
  font-weight: 900;
  color: var(--ink);
  font-size: 12px;
}

.log-contact-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.log-block {
  padding: 9px;
}

.log-block-title {
  margin-bottom: 8px;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 950;
}

.log-field-grid {
  display: grid;
  grid-template-columns: minmax(110px, .55fr) 1fr;
  gap: 5px 10px;
}

.log-field-name {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.log-field-value {
  color: var(--ink-soft);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.log-change-list,
.log-updated-list {
  display: grid;
  gap: 6px;
}

.log-change-row {
  display: grid;
  grid-template-columns: minmax(110px, .55fr) 1fr;
  gap: 10px;
  align-items: start;
}

.log-change-field {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.log-change-values {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.log-change-values span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.log-change-values b {
  color: var(--purple);
}

.log-contact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

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

.log-mini-grid {
  padding: 8px 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
}

.log-mini-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: capitalize;
}

.log-mini-grid b {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.top-actions .top-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.top-actions #importButton {
  background: #f6f2ff;
  color: var(--purple);
  border-color: #cbc4ff;
}

.top-actions #adminButton {
  background: rgba(117, 102, 200, .3);
  border-color: rgba(255, 255, 255, .18);
}

@media (max-width: 1480px) {
  .filter-card {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }
  .field-toggles {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .custom-badge-row {
    grid-template-columns: 1fr;
  }
}

.import-file-name {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  max-width: 100%;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(35, 34, 49, .08);
  color: #232231;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-result.error {
  border-color: #ffd1d8;
  background: #fff5f6;
  color: #9d2839;
}

.import-progress {
  margin-top: 10px;
  color: #6a667a;
  font-size: 12px;
  font-weight: 800;
}

html {
  scroll-behavior: smooth;
}

button,
.contact-card,
.nav-item,
.metric-card,
.context-bar,
.filter-card,
.profile-card,
.modal-card,
.import-drop,
.info-row {
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease, border-color .18s ease, background .18s ease, color .18s ease, opacity .18s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0) scale(.99);
}

button:disabled {
  opacity: .48;
  cursor: not-allowed;
  box-shadow: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(117, 102, 200, .25);
  outline-offset: 2px;
}

.metric-card:hover,
.context-bar:hover,
.filter-card:hover,
.profile-card:hover {
  box-shadow: 0 16px 38px rgba(40, 38, 54, .08);
}

.nav-item:hover {
  transform: translateX(2px);
}

.contacts-toolbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 4px 12px;
  background: linear-gradient(180deg, #fff 76%, rgba(255, 255, 255, 0));
}

.contacts-toolbar-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contacts-toolbar-copy strong {
  font-size: 14px;
  font-weight: 950;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.contacts-toolbar-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.contacts-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.compact-btn {
  min-height: 34px;
  border-radius: 11px;
  padding: 0 12px;
  font-size: 12px;
}

.contact-card {
  animation: cardIn .2s ease both;
}

.contact-card:nth-child(2n) {
  animation-delay: .015s;
}

.contact-card:nth-child(3n) {
  animation-delay: .03s;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-backdrop {
  animation: fadeIn .16s ease both;
}

.modal-shell {
  animation: modalIn .2s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.import-drop:hover {
  border-color: var(--accent);
  box-shadow: 0 18px 42px rgba(117, 102, 200, .14);
  transform: translateY(-1px);
}

.top-link-btn:hover,
.primary-btn:hover,
.dark-btn:hover,
.light-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.tiny-btn:hover,
.load-more:hover,
.sidebar-action:hover {
  box-shadow: 0 14px 30px rgba(48, 42, 69, .12);
}

.tag-badge,
.custom-badge,
.color-label,
.country-chip,
.count-pill {
  transition: transform .15s ease, box-shadow .15s ease;
}

.tag-badge:hover,
.custom-badge:hover,
.color-label:hover,
.country-chip:hover {
  transform: translateY(-1px);
}

@media (max-width: 760px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  body {
    background: #f3f2ef;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
  }

  .topbar {
    position: sticky;
    top: 0;
    height: auto;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 12px 12px;
    flex: 0 0 auto;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-title {
    font-size: 15px;
  }

  .brand-subtitle {
    font-size: 11px;
  }

  .top-search input {
    height: 42px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .top-link-btn {
    min-width: 0;
    padding: 0 8px;
    font-size: 12px;
  }

  .layout {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 10px 10px 108px;
    gap: 10px;
  }

  .left-panel {
    height: auto;
    max-height: none;
    overflow: visible;
    border-radius: 18px;
  }

  .sidebar-actions {
    grid-template-columns: 1fr 1fr;
  }

  .mode-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow-x: auto;
  }

  .mode-tabs button {
    min-width: 84px;
    font-size: 12px;
  }

  .nav-tools {
    grid-template-columns: 1fr;
  }

  .nav-tools select {
    min-width: 0;
  }

  .nav-list {
    max-height: 260px;
  }

  .main-panel {
    height: auto;
    overflow: visible;
    gap: 10px;
  }

  .metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-card {
    padding: 13px;
  }

  .metric-card span {
    font-size: 22px;
  }

  .context-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .context-actions {
    width: 100%;
    justify-content: stretch;
  }

  .context-actions button {
    flex: 1 1 auto;
  }

  .filter-card {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .field-toggles {
    gap: 6px;
  }

  .field-toggles label {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: visible;
    gap: 10px;
  }

  .contacts-panel,
  .detail-panel {
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 8px;
  }

  .contacts-toolbar {
    position: sticky;
    top: 137px;
    align-items: flex-start;
    flex-direction: column;
    padding: 8px 2px 10px;
  }

  .contacts-toolbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .contact-card {
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: flex-start;
    padding: 12px;
  }

  .contact-side {
    grid-column: 2;
    justify-content: flex-start;
  }

  .contact-name-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .contact-name,
  .contact-sub,
  .contact-meta {
    white-space: normal;
  }

  .detail-panel {
    order: 2;
  }

  .profile-card {
    padding: 14px;
  }

  .profile-top {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .profile-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 17px;
  }

  .detail-title {
    font-size: 18px;
  }

  .info-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .info-row strong {
    text-align: left;
  }

  .selection-dock {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    min-width: 0;
    max-width: none;
    transform: translateY(120%);
    border-radius: 18px;
  }

  .selection-dock.visible {
    transform: translateY(0);
  }

  .selection-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-actions button {
    min-width: 0;
    font-size: 12px;
    padding: 0 8px;
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 10px;
  }

  .modal-shell {
    width: 100%;
    max-height: calc(100vh - 20px);
  }

  .modal-card {
    border-radius: 22px;
    padding: 16px;
  }

  .form-row,
  .custom-field-row,
  .custom-badge-row,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .logs-list {
    max-height: 360px;
  }
}

@media (max-width: 460px) {
  .metric-row,
  .top-actions,
  .contacts-toolbar-actions,
  .selection-actions {
    grid-template-columns: 1fr;
  }

  .sidebar-actions {
    grid-template-columns: 1fr;
  }

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

  .field-toggles label {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}


/* v9 polish */
:root {
  --page: #f4f3ef;
  --paper: #ffffff;
  --ink: #222033;
  --ink-soft: #3d3854;
  --muted: #817d8d;
  --line: #e2e0e8;
  --line-soft: #eceaf1;
  --purple: #252336;
  --purple-2: #37314d;
  --accent: #7b6ad7;
  --accent-2: #5f52b5;
  --accent-soft: #f0edff;
  --shadow: 0 16px 45px rgba(30, 28, 42, .085);
  --shadow-soft: 0 8px 24px rgba(30, 28, 42, .055);
}

body {
  background:
    radial-gradient(circle at 8% 0%, rgba(123, 106, 215, .09), transparent 28%),
    linear-gradient(180deg, #f7f6f2 0%, #efeee9 100%);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  background: linear-gradient(90deg, #201f30 0%, #29253d 55%, #211f31 100%);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 12px 32px rgba(24, 22, 34, .22);
}

.brand-title {
  letter-spacing: .01em;
}

.top-search input {
  background: rgba(255,255,255,.095);
  border-color: rgba(255,255,255,.16);
  border-radius: 14px;
}

.top-search input:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.24);
}

.left-panel,
.metric-card,
.context-bar,
.filter-card,
.contacts-panel,
.detail-panel,
.modal-card,
.auth-card {
  border-color: rgba(35, 32, 53, .075);
  box-shadow: var(--shadow-soft);
}

.left-panel,
.contacts-panel,
.detail-panel {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
}

.metric-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fff, #fbfaf8);
}


.metric-card span {
  letter-spacing: -.03em;
}

.context-bar,
.filter-card {
  background: rgba(255,255,255,.94);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #cbc6dc;
}

.mode-tabs,
.field-toggles label {
  background: #f3f1ed;
}

.mode-tabs button,
.nav-item,
.contact-card,
.primary-btn,
.dark-btn,
.light-btn,
.ghost-btn,
.danger-btn,
.tiny-btn,
.top-link-btn,
.sidebar-action,
.icon-btn,
.load-more {
  transition: border-color .16s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.primary-btn {
  background: linear-gradient(180deg, #8575e3, #6f5fd1);
  box-shadow: 0 10px 20px rgba(123, 106, 215, .22);
}

.primary-btn:hover {
  background: linear-gradient(180deg, #8f80ec, #7160d4);
  box-shadow: 0 12px 24px rgba(123, 106, 215, .28);
}

.dark-btn:hover,
.sidebar-action:hover,
.light-btn:hover,
.ghost-btn:hover,
.top-link-btn:hover,
.icon-btn:hover {
  box-shadow: 0 8px 18px rgba(35, 32, 53, .1);
}

.nav-item {
  min-height: 54px;
}

.nav-item:hover {
  background: #f8f6f1;
  border-color: #e8e4dc;
}

.nav-item.active {
  background: linear-gradient(180deg, #f4f1ff, #eeeaff);
  border-color: #c9c1ff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.contacts-toolbar {
  border-bottom: 1px solid rgba(35, 32, 53, .055);
  margin-bottom: 8px;
}

.contact-card {
  animation: none !important;
  transform: none !important;
  border-color: #edeaf2;
  background: linear-gradient(180deg, #fff, #fffdfb);
  box-shadow: 0 1px 0 rgba(35, 32, 53, .03);
  position: relative;
}

.contact-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: transparent;
}

.contact-card:hover {
  transform: none !important;
  border-color: #d7d1f4;
  background: #fff;
  box-shadow: 0 10px 24px rgba(35, 32, 53, .075);
}

.contact-card.active {
  background: linear-gradient(180deg, #fbfaff, #f8f5ff);
  border-color: #bfb6fb;
  box-shadow: 0 12px 28px rgba(123, 106, 215, .14);
}

.contact-card.active::before {
  background: var(--accent);
}

.contact-card[data-color="vip"]::before,
.contact-card[data-color="partner"]::before { background: #8ab98b; }
.contact-card[data-color="hot"]::before { background: #ef6674; }
.contact-card[data-color="followup"]::before { background: #f2bf62; }
.contact-card[data-color="later"]::before { background: #8e86a6; }

.contact-name {
  letter-spacing: -.01em;
}

.country-chip,
.tag-badge,
.custom-badge,
.color-label {
  border-radius: 999px;
}

.tag-badge.warning {
  background: #fff4d8;
  color: #795315;
  border: 1px solid #f2d59b;
}

.profile-card {
  background: #fff;
  border-radius: 20px;
}

.profile-top {
  padding-bottom: 14px;
  border-bottom: 1px solid #efedf3;
}

.info-row {
  background: #f8f7f3;
  border: 1px solid transparent;
}

.info-row:hover {
  border-color: #e8e5dc;
  background: #fbfaf7;
}

.notes-box {
  border: 1px solid #ece9df;
  background: #fbfaf7;
}

.mobile-detail-close {
  display: none;
}

.modal-card {
  box-shadow: 0 24px 70px rgba(24, 22, 34, .24);
}

.modal-backdrop {
  backdrop-filter: blur(8px);
}

@media (min-width: 1241px) {
  .workspace {
    grid-template-columns: minmax(580px, 1.55fr) minmax(430px, .85fr);
  }
  .contacts-list {
    padding-bottom: 8px;
  }
}

@media (max-width: 760px) {
  body.detail-open {
    overflow: hidden;
  }

  .topbar {
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

  .brand {
    min-height: 40px;
  }

  .top-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .layout {
    padding: 10px 10px 104px;
  }

  .left-panel,
  .contacts-panel,
  .filter-card,
  .context-bar,
  .metric-card {
    border-radius: 18px;
  }

  .metric-row {
    display: none;
  }

  .nav-list {
    max-height: 220px;
  }

  .contacts-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(180deg, rgba(255,255,255,.98) 78%, rgba(255,255,255,0));
  }

  .contact-card {
    min-height: 92px;
    border-radius: 16px;
    padding: 13px 12px;
  }

  .contact-card:hover {
    box-shadow: 0 1px 0 rgba(35, 32, 53, .03);
  }

  .contact-card:active {
    background: #f8f5ff;
    border-color: #c8bfff;
  }

  .contact-tags {
    margin-top: 2px;
  }

  .detail-panel {
    display: none;
  }

  .detail-panel.mobile-open {
    display: block;
    position: fixed;
    z-index: 120;
    inset: 0;
    height: 100dvh;
    max-height: none;
    overflow-y: auto;
    padding: 12px;
    border: 0;
    border-radius: 0;
    background: rgba(244, 243, 239, .98);
    box-shadow: none;
    overscroll-behavior: contain;
  }

  .detail-panel.mobile-open .profile-card {
    min-height: calc(100dvh - 24px);
    border: 1px solid rgba(35, 32, 53, .075);
    box-shadow: 0 16px 45px rgba(30, 28, 42, .14);
  }

  .mobile-detail-close {
    width: 100%;
    min-height: 42px;
    margin-bottom: 12px;
    border: 1px solid #ded9f6;
    border-radius: 14px;
    background: #f4f1ff;
    color: var(--purple);
    font-weight: 950;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .profile-top {
    grid-template-columns: 50px minmax(0, 1fr) auto;
    align-items: start;
  }

  .profile-actions {
    grid-column: auto;
    justify-content: flex-end;
  }

  .detail-actions .primary-btn {
    width: 100%;
  }

  .modal-shell {
    max-height: calc(100dvh - 20px);
  }

  .modal-card {
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }
}

@media (max-width: 430px) {
  .profile-top {
    grid-template-columns: 48px minmax(0, 1fr);
  }
  .profile-actions {
    grid-column: 1 / -1;
  }
}

.clearable-search {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.clearable-search input[type="search"] {
  padding-right: 38px;
}

.search-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  width: 26px;
  height: 26px;
  transform: translateY(-50%) scale(.88);
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease, background .14s ease, color .14s ease;
}

.clearable-search.has-value .search-clear {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.search-clear:hover {
  background: rgba(117, 102, 200, .12);
  color: var(--accent);
}

.top-search .search-clear {
  color: rgba(255, 255, 255, .68);
}

.top-search .search-clear:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.nav-item {
  cursor: pointer;
}

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

.nav-rename-btn {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 950;
  opacity: 0;
  transform: translateX(3px);
  transition: opacity .14s ease, transform .14s ease, background .14s ease, color .14s ease, border .14s ease;
}

.nav-item:hover .nav-rename-btn,
.nav-item.active .nav-rename-btn,
.nav-rename-btn:focus-visible {
  opacity: 1;
  transform: translateX(0);
}

.nav-rename-btn:hover {
  background: #fff;
  border-color: #d5cff7;
  color: var(--accent);
  box-shadow: 0 8px 18px rgba(48, 42, 69, .08);
}

.metric-card {
  position: relative;
  overflow: hidden;
}


.metric-card span,
.metric-card small {
  position: relative;
  z-index: 1;
}

@media (max-width: 760px) {
  .nav-rename-btn {
    opacity: 1;
    transform: none;
  }
}


.metric-card::after {
  content: none !important;
  display: none !important;
}

.metric-card {
  background: #fff;
}

.badge-filter {
  position: relative;
  min-width: 0;
}

.badge-filter-toggle {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 760;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.32);
  transition: border .16s ease, box-shadow .16s ease, transform .16s ease;
}

.badge-filter-toggle:hover,
.badge-filter.open .badge-filter-toggle {
  border-color: #c7c0ef;
  box-shadow: 0 10px 22px rgba(86, 72, 145, .08);
}

.badge-filter-caret {
  color: var(--muted);
  font-size: 14px;
}

.badge-filter-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  width: min(420px, 92vw);
  max-height: 430px;
  overflow: hidden;
  border: 1px solid #d9d5ec;
  border-radius: 18px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 24px 60px rgba(42, 37, 62, .18);
  padding: 10px;
  backdrop-filter: blur(16px);
}

.badge-filter-menu input[type=search] {
  width: 100%;
  margin-bottom: 8px;
}

.badge-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 8px;
}

.badge-mode-switch label {
  height: 32px;
  border: 1px solid #e4e0f3;
  border-radius: 999px;
  background: #f8f7fb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 850;
  color: var(--ink-soft);
}

.badge-mode-switch input {
  accent-color: var(--purple);
}

.badge-filter-options {
  max-height: 280px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 2px;
}

.badge-filter-option {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  cursor: pointer;
}

.badge-filter-option:hover {
  background: #f5f3ff;
  border-color: #e2def7;
}

.badge-filter-option input {
  accent-color: var(--purple);
}

.badge-filter-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 850;
}

.badge-filter-count {
  min-width: 28px;
  text-align: center;
  border-radius: 999px;
  background: #efedf8;
  color: var(--purple);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 900;
}

.badge-filter-empty {
  padding: 22px 10px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.badge-filter-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid #eeebf5;
}

@media (max-width: 760px) {
  .badge-filter-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 88px;
    width: auto;
    max-height: min(560px, calc(100vh - 120px));
  }
  .badge-mode-switch {
    grid-template-columns: 1fr;
  }
}

.badge-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.badge-filter-chips button {
  min-height: 24px;
  max-width: 100%;
  border: 1px solid #dcd7ef;
  border-radius: 999px;
  background: #f4f2ff;
  color: var(--purple);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 900;
}

.badge-filter-chips span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-filter-chips b {
  font-size: 13px;
  line-height: 1;
}

/* v15 badge filter polish */
.badge-filter {
  position: relative;
  min-width: 0;
}

.badge-filter-toggle {
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none;
  transform: none !important;
}

.badge-filter-toggle:hover,
.badge-filter.open .badge-filter-toggle {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(117, 102, 200, .12);
  background: #fff;
}

.badge-filter-caret {
  font-size: 13px;
  color: var(--muted);
  line-height: 1;
}

.badge-filter-menu {
  top: calc(100% + 6px);
  width: min(360px, 92vw);
  max-height: 380px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 18px 48px rgba(35, 33, 52, .16);
  padding: 8px;
  overflow: hidden;
  backdrop-filter: none;
}

.badge-filter-menu input[type=search] {
  height: 38px;
  margin: 0 0 8px;
  border-radius: 10px;
  font-weight: 400;
}

.badge-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 3px;
  margin: 0 0 8px;
  border: 1px solid #e7e4ef;
  border-radius: 11px;
  background: #f6f5fa;
}

.badge-mode-switch label {
  position: relative;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}

.badge-mode-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.badge-mode-switch label:has(input:checked) {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(35, 33, 52, .08);
}

.badge-filter-options {
  max-height: 246px;
  gap: 2px;
  padding: 2px 2px 2px 0;
}

.badge-filter-option {
  min-height: 34px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  color: var(--ink);
}

.badge-filter-option:hover {
  background: #f7f6fb;
  border-color: transparent;
}

.badge-filter-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.badge-filter-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.badge-filter-count {
  min-width: 0;
  background: #f0eef6;
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 650;
}

.badge-filter-footer {
  justify-content: flex-start;
  border-top: 1px solid #efedf4;
  margin-top: 8px;
  padding-top: 8px;
}

.badge-filter-chips {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.badge-filter-chips button {
  border-color: #e1def1;
  background: #f7f5ff;
  color: var(--ink-soft);
  font-weight: 650;
}

@media (max-width: 760px) {
  .badge-filter-menu {
    left: 10px;
    right: 10px;
    bottom: 78px;
    width: auto;
    max-height: min(480px, calc(100vh - 120px));
    border-radius: 14px;
  }
  .badge-mode-switch {
    grid-template-columns: 1fr 1fr;
  }
}

/* v16 unified tag/badge filters */
.filter-card {
  grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) minmax(130px, 160px) minmax(190px, 240px) minmax(320px, 1.6fr);
  align-items: start;
}

.badge-filter.compact-filter {
  position: relative;
  min-width: 0;
  height: 40px;
}

.badge-filter.compact-filter .badge-filter-toggle {
  height: 40px;
  min-height: 40px;
  width: 100%;
  border-radius: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}

.badge-filter.compact-filter .badge-filter-toggle span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-filter.compact-filter .badge-filter-menu {
  top: calc(100% + 6px);
  width: min(360px, 92vw);
  max-height: 384px;
  z-index: 80;
}

.badge-filter.compact-filter .clearable-search {
  display: block;
  width: 100%;
  margin: 0 0 8px;
}

.badge-filter.compact-filter .badge-filter-menu input[type=search] {
  margin: 0;
  width: 100%;
}

.badge-mode-switch,
.badge-filter-chips {
  display: none !important;
}

.badge-filter-option {
  font-weight: 500;
}

.badge-filter-option input {
  flex: 0 0 auto;
}

.badge-filter-name {
  font-weight: 500 !important;
}

.badge-filter-count {
  font-weight: 650 !important;
}

@media (max-width: 1180px) {
  .filter-card {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
  .field-toggles {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .filter-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .badge-filter.compact-filter .badge-filter-menu {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 78px;
    top: auto;
    width: auto;
    max-height: min(480px, calc(100vh - 120px));
  }
}

/* v17 polish: consistent filter arrows, copyable details */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 5.25L7 8.25L10 5.25' fill='none' stroke='%237e7a8b' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  padding-right: 36px;
}

.badge-filter.compact-filter .badge-filter-toggle,
.badge-filter-toggle {
  position: relative;
  padding-right: 36px;
}

.badge-filter-caret {
  display: none !important;
}

.badge-filter-toggle::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.7px solid var(--muted);
  border-bottom: 1.7px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.copy-value {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  padding: 0;
  margin: 0;
  max-width: 100%;
  cursor: copy;
  border-radius: 7px;
  transition: color .14s ease, background .14s ease, box-shadow .14s ease;
}

.copy-value:hover {
  color: var(--accent);
  background: rgba(117, 102, 200, .08);
  box-shadow: 0 0 0 4px rgba(117, 102, 200, .08);
}

.detail-email.copy-value {
  display: inline-block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-copy {
  font-weight: inherit;
  overflow-wrap: anywhere;
}

.info-row a {
  color: var(--accent);
  text-decoration: none;
  border-radius: 7px;
  transition: color .14s ease, background .14s ease, box-shadow .14s ease;
}

.info-row a:hover {
  color: var(--purple);
  background: rgba(117, 102, 200, .08);
  box-shadow: 0 0 0 4px rgba(117, 102, 200, .08);
}

.contact-email-list {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* v18 sidebar mode tabs borders */
.mode-tabs {
  gap: 7px;
  padding: 6px;
  background: #f3f1ed;
  border: 1px solid #e5e1d8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.mode-tabs button {
  border: 1px solid rgba(42, 38, 58, .12);
  background: rgba(255,255,255,.54);
  color: #7b7688;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.mode-tabs button:hover {
  border-color: rgba(117, 102, 200, .34);
  background: #ffffff;
  color: var(--ink);
}

.mode-tabs button.active {
  border-color: var(--purple);
  background: linear-gradient(180deg, #332d49, #28233a);
  color: #fff;
  box-shadow: 0 10px 20px rgba(48,42,69,.2), inset 0 1px 0 rgba(255,255,255,.1);
}
.inline-editor-card {
  padding-bottom: 12px;
}

.inline-editor-top {
  align-items: flex-start;
}

.inline-editor-head-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-action {
  min-height: 36px;
  padding-inline: 14px;
}


.inline-contact-form {
  gap: 14px;
}

.inline-contact-form .field {
  min-width: 0;
}

.inline-contact-form input,
.inline-contact-form select,
.inline-contact-form textarea {
  background: #fbfaf8;
}

.inline-contact-form input:hover,
.inline-contact-form select:hover,
.inline-contact-form textarea:hover {
  border-color: #d8d0ff;
  background: #fff;
}

.inline-contact-form textarea[name="notes"] {
  min-height: 132px;
}

.custom-badge-row,
.custom-field-row {
  align-items: center;
}

.custom-badge-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, .7fr) 36px;
  gap: 8px;
  margin-bottom: 8px;
}

.editor-floating-actions {
  position: sticky;
  bottom: 12px;
  z-index: 6;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 18px 0 0;
  padding: 12px;
  border: 1px solid rgba(222, 217, 246, .9);
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 18px 40px rgba(35, 32, 53, .13);
  backdrop-filter: blur(18px);
}

.editor-floating-actions .primary-btn,
.editor-floating-actions .light-btn {
  min-height: 42px;
  padding-inline: 20px;
}

.inline-editor-card .avatar {
  box-shadow: 0 14px 28px rgba(117, 102, 200, .23);
}

@media (max-width: 760px) {
  .inline-editor-top {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .inline-editor-head-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: stretch;
  }

  .inline-editor-head-actions .primary-btn,
  .inline-editor-head-actions .light-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .inline-contact-form .form-row,
  .custom-badge-row,
  .custom-field-row {
    grid-template-columns: 1fr;
  }

  .custom-badge-row .icon-btn,
  .custom-field-row .icon-btn {
    width: 100%;
  }

  .editor-floating-actions {
    bottom: 10px;
    justify-content: stretch;
  }

  .editor-floating-actions .primary-btn,
  .editor-floating-actions .light-btn {
    flex: 1 1 0;
    justify-content: center;
  }
}

/* v21 compact view card and floating edit actions */
.contact-view-card {
  position: relative;
  padding-bottom: 28px;
}

.contact-view-top {
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(222, 221, 229, .78);
}

.contact-floating-actions {
  position: sticky;
  top: 12px;
  z-index: 18;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  width: fit-content;
  margin: -2px 0 12px auto;
  padding: 6px;
  border: 1px solid rgba(222, 217, 246, .92);
  border-radius: 16px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 16px 34px rgba(35, 32, 53, .12);
  backdrop-filter: blur(16px);
}

.floating-icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(222, 221, 229, .95);
  border-radius: 13px;
  display: inline-grid;
  place-items: center;
  background: #fff;
  color: var(--ink);
  font-weight: 950;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}

.floating-icon-btn:hover {
  border-color: rgba(117, 102, 200, .45);
  color: var(--accent);
  background: #fbfaff;
}

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

.detail-value-field {
  min-width: 0;
}

.detail-value-field.full {
  grid-column: 1 / -1;
}

.detail-value-label {
  margin: 0 0 6px;
  color: #7b7688;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.detail-value-body {
  min-height: 41px;
  width: 100%;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfaf8;
  color: var(--ink);
  overflow: hidden;
}

.detail-value-copy,
.detail-value-link,
.detail-value-empty {
  width: 100%;
  min-height: 39px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.detail-value-copy:hover {
  background: rgba(117, 102, 200, .075);
  color: var(--purple);
}

.detail-value-link {
  color: var(--accent);
  text-decoration: none;
}

.detail-value-link:hover {
  background: rgba(117, 102, 200, .075);
  color: var(--purple);
}

.detail-value-empty {
  color: #a8a3b2;
}

.compact-section {
  margin-top: 16px;
}

.custom-value-grid {
  margin-top: 4px;
}

.notes-copy {
  width: 100%;
  border: 1px solid rgba(222, 221, 229, .95);
  text-align: left;
}

.notes-copy:hover {
  background: #fff;
  border-color: rgba(117, 102, 200, .35);
}

@media (max-width: 980px) {
  .detail-value-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .contact-floating-actions {
    top: 10px;
    margin-right: 0;
  }

  .contact-view-top {
    grid-template-columns: 50px minmax(0, 1fr);
  }
}

/* v22 sticky detail header and cleaner notes spacing */
.contact-view-card,
.inline-editor-card {
  position: relative;
  overflow: visible;
}

.sticky-detail-header {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: -18px -18px 18px;
  padding: 18px;
  border-bottom: 1px solid rgba(222, 221, 229, .86);
  border-radius: 20px 20px 0 0;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 24px rgba(35, 32, 53, .055);
  backdrop-filter: blur(18px);
}

.contact-view-top,
.inline-editor-top {
  min-height: 88px;
}

.header-contact-actions,
.header-editor-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  align-self: center;
}

.header-contact-actions {
  padding: 6px;
  border: 1px solid rgba(222, 217, 246, .95);
  border-radius: 16px;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 12px 30px rgba(35, 32, 53, .09);
}

.header-icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(222, 221, 229, .95);
  border-radius: 13px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(180deg, #fff, #fbfaf8);
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95), 0 8px 18px rgba(35, 32, 53, .045);
  transition: transform .14s ease, border-color .14s ease, color .14s ease, background .14s ease, box-shadow .14s ease;
}

.header-icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(117, 102, 200, .45);
  color: var(--accent);
  background: #fbfaff;
  box-shadow: 0 10px 22px rgba(117, 102, 200, .14);
}

.header-icon-btn.danger-icon:hover {
  border-color: rgba(239, 102, 116, .48);
  color: var(--red);
  background: #fff7f8;
  box-shadow: 0 10px 22px rgba(239, 102, 116, .13);
}

.header-editor-actions .primary-btn,
.header-editor-actions .light-btn {
  min-height: 40px;
  padding-inline: 18px;
  box-shadow: 0 10px 22px rgba(35, 32, 53, .075);
}

.notes-box.notes-copy,
button.notes-box.notes-copy {
  display: block;
  width: 100%;
  min-height: 78px;
  padding: 16px 18px;
  line-height: 1.45;
  text-align: left;
}

@media (max-width: 760px) {
  .sticky-detail-header {
    margin: -12px -12px 14px;
    padding: 14px 12px;
    border-radius: 18px 18px 0 0;
  }

  .contact-view-top,
  .inline-editor-top {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 74px;
  }

  .header-contact-actions {
    padding: 4px;
    gap: 5px;
    border-radius: 14px;
  }

  .header-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .header-editor-actions {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .header-editor-actions .primary-btn,
  .header-editor-actions .light-btn {
    width: 100%;
    justify-content: center;
  }
}


/* v23 sticky header actions: no extra wrapper panel */
.header-contact-actions {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.header-icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(222, 221, 229, .9);
  border-radius: 14px;
  background: rgba(255, 255, 255, .62);
  box-shadow: none;
}

.header-icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(247, 245, 255, .92);
  border-color: rgba(117, 102, 200, .45);
  box-shadow: 0 8px 18px rgba(117, 102, 200, .12);
}

.header-icon-btn.danger-icon:hover {
  background: rgba(255, 247, 248, .94);
  border-color: rgba(239, 102, 116, .45);
  box-shadow: 0 8px 18px rgba(239, 102, 116, .12);
}

@media (max-width: 720px) {
  .header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }
}

.flag-icon {
  width: 21px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(30, 27, 48, .12);
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
}

.flag-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.flag-placeholder {
  background: #f4f2ef;
}

.nav-icon .flag-icon {
  width: 24px;
  height: 18px;
  border-radius: 4px;
}

.country-chip .flag-icon,
.country-value-copy .flag-icon {
  width: 19px;
  height: 14px;
}

.country-value-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
