:root {
  --bg-shell: #f8fafd;
  --bg-card: #ffffff;
  --bg-surface-alt: #f0f4f9;
  --bg-search: #e9eef6;
  --bg-hover: #f0f4f9;
  --bg-active-pill: #c2e7ff;
  --bg-banner: #d3e3fd;
  --text-primary: #1f1f1f;
  --text-secondary: #444746;
  --text-muted: #5f6368;
  --accent-blue: #0b57d0;
  --accent-blue-hover: #0842a0;
  --accent-on-pill: #001d35;
  --border-subtle: #e0e2e0;
  --border-card: #c4c7c5;
  --danger-red: #b3261e;
  --star-amber: #fbbc04;
  --shadow-elevated: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
  --shadow-popover: 0 2px 6px 2px rgba(60, 64, 67, 0.15), 0 1px 2px 0 rgba(60, 64, 67, 0.3);
  --font-sans: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-shell);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 22px;
  line-height: 1;
  user-select: none;
}

.material-symbols-outlined.filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* App Shell */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-shell);
}

/* Topbar */
.topbar {
  height: 64px;
  min-height: 64px;
  display: flex;
  align-items: center;
  padding: 8px 16px 8px 12px;
  gap: 12px;
  background: var(--bg-shell);
  position: relative;
  z-index: 30;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 244px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: 8px;
  color: var(--text-secondary);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.2px;
  color: #444746;
}

.topbar-search-wrap {
  flex: 1;
  max-width: 720px;
  position: relative;
}

.search-box {
  height: 46px;
  background: var(--bg-search);
  border-radius: 24px;
  display: flex;
  align-items: center;
  padding: 0 8px 0 16px;
  gap: 12px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.search-box:focus-within {
  background: #ffffff;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.search-icon {
  color: var(--text-secondary);
  font-size: 21px;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--text-primary);
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-dropdown {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--shadow-popover);
  max-height: 380px;
  overflow-y: auto;
  z-index: 60;
  padding: 8px 0;
}

.search-drop-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.1s;
}

.search-drop-item:hover {
  background: var(--bg-hover);
}

.search-drop-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-drop-name {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.15s ease;
}

.icon-btn:hover {
  background: rgba(68, 71, 70, 0.08);
}

.icon-btn-sm {
  width: 30px;
  height: 30px;
}

.icon-btn-sm .material-symbols-outlined {
  font-size: 18px;
}

.account-avatar-btn {
  width: 34px;
  height: 34px;
  margin-left: 6px;
  border-radius: 50%;
  border: 2px solid #d3e3fd;
  background: var(--accent-blue);
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.15s ease;
}

.account-avatar-btn:hover {
  box-shadow: 0 0 0 4px rgba(11, 87, 208, 0.12);
}

/* Popovers */
.popover-anchor {
  position: relative;
}

.popover-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: var(--shadow-popover);
  padding: 6px 0;
  min-width: 210px;
  z-index: 80;
}

.create-dropdown {
  left: 0;
  right: auto;
  top: calc(100% + 4px);
  min-width: 240px;
  border-radius: 8px;
}

.menu-item {
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-size: 14px;
  text-align: left;
}

.menu-item:hover {
  background: var(--bg-hover);
}

.menu-item .material-symbols-outlined {
  font-size: 20px;
  color: var(--text-secondary);
}

.menu-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 6px 0;
}

.apps-menu {
  width: 300px;
  padding: 14px;
  border-radius: 20px;
}

.apps-menu-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding: 0 4px;
}

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

.app-tile {
  border: none;
  background: transparent;
  border-radius: 12px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-primary);
}

.app-tile:hover {
  background: var(--bg-surface-alt);
}

.app-tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-tile-icon.blue { background: #e8f0fe; color: #0b57d0; }
.app-tile-icon.sky { background: #c2e7ff; color: #001d35; }
.app-tile-icon.green { background: #e6f4ea; color: #137333; }
.app-tile-icon.amber { background: #fef7e0; color: #b06000; }
.app-tile-icon.purple { background: #f3e8fd; color: #7627bb; }
.app-tile-icon.slate { background: #f1f3f4; color: #3c4043; }

.account-menu {
  width: 310px;
  padding: 16px;
  border-radius: 20px;
  background: #e9eef6;
}

.account-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.account-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #ffffff;
  font-size: 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.account-card-name {
  font-size: 16px;
  font-weight: 500;
}

.account-card-email {
  font-size: 12px;
  color: var(--text-muted);
}

.account-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  width: 100%;
}

/* Workspace Layout */
.workspace {
  flex: 1;
  display: flex;
  min-height: 0;
  padding: 0 16px 16px 0;
  position: relative;
}

/* Left Sidebar */
.sidebar {
  width: 268px;
  min-width: 268px;
  padding: 4px 12px 16px 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg-shell);
  transition: width 0.2s ease, min-width 0.2s ease, padding 0.2s ease, opacity 0.2s ease;
}

.workspace.sidebar-collapsed .sidebar {
  width: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  opacity: 0;
}

.create-btn-wrap {
  margin: 4px 0 14px 4px;
}

.btn-create {
  height: 56px;
  padding: 0 22px 0 16px;
  border: none;
  border-radius: 16px;
  background: var(--bg-active-pill);
  color: var(--accent-on-pill);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

.btn-create:hover {
  background: #b5deff;
  box-shadow: var(--shadow-elevated);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  height: 40px;
  padding: 0 14px 0 16px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.12s ease;
}

.nav-item:hover {
  background: rgba(68, 71, 70, 0.08);
}

.nav-item.active {
  background: var(--bg-active-pill);
  color: var(--accent-on-pill);
}

.nav-item.active .nav-icon {
  color: var(--accent-on-pill);
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.nav-icon {
  color: var(--text-secondary);
  font-size: 20px;
}

.nav-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-count {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-info {
  font-size: 17px;
  color: var(--text-muted);
}

.nav-badge {
  background: var(--danger-red);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-section-header {
  margin: 14px 0 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.labels-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-right: 4px;
}

.sidebar-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.label-nav-item {
  position: relative;
}

.label-row-actions {
  display: none;
  align-items: center;
  gap: 2px;
}

.label-nav-item:hover .label-row-actions {
  display: flex;
}

.label-nav-item:hover .nav-count {
  display: none;
}

/* Main White Card */
.main-card {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Right Contextual Birthday Panel */
.right-panel-toggle {
  position: relative;
  align-self: center;
  width: 28px;
  height: 28px;
  margin: 0 -14px 0 2px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  z-index: 15;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}

.right-panel-toggle:hover {
  background: var(--bg-surface-alt);
}

.right-panel-toggle .material-symbols-outlined {
  font-size: 18px;
}

.right-panel {
  width: 296px;
  min-width: 296px;
  margin-left: 16px;
  background: var(--bg-card);
  border-radius: 16px;
  overflow-y: auto;
  transition: width 0.2s ease, min-width 0.2s ease, margin 0.2s ease, opacity 0.2s ease;
}

.workspace.right-collapsed .right-panel {
  width: 0;
  min-width: 0;
  margin-left: 0;
  opacity: 0;
  overflow: hidden;
}

.right-panel-inner {
  padding: 20px;
}

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

.rp-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.rp-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0 0 16px 0;
}

.rp-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rp-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rp-person-info {
  flex: 1;
  min-width: 0;
}

.rp-person-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.rp-more-btn {
  margin-top: 14px;
  border: none;
  background: transparent;
  color: var(--accent-blue);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 18px;
}

.rp-more-btn:hover {
  background: rgba(11, 87, 208, 0.08);
}

/* Duplicate Banner */
.dup-banner {
  margin: 14px 24px 0 24px;
  padding: 10px 16px;
  background: var(--bg-banner);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--accent-on-pill);
}

.dup-banner-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dup-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-text-blue {
  border: none;
  background: transparent;
  color: var(--accent-blue);
  font-weight: 500;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 18px;
}

.btn-text-blue:hover {
  background: rgba(11, 87, 208, 0.08);
}

/* Page Header & Contacts Table */
.list-header {
  padding: 18px 24px 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.list-title {
  font-size: 22px;
  font-weight: 400;
  margin: 0;
  color: var(--text-primary);
}

.list-count {
  font-size: 14px;
  color: var(--text-secondary);
}

.contacts-table-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 16px 6px 24px;
  display: grid;
  grid-template-columns: 36px minmax(180px, 1.5fr) minmax(150px, 1.3fr) minmax(130px, 1fr) minmax(140px, 1.2fr) 118px;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.selection-bar {
  position: sticky;
  top: 0;
  z-index: 11;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 16px 6px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  color: var(--accent-blue);
}

.selection-left {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 500;
}

.selection-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.section-subheading {
  padding: 16px 24px 6px 24px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.contact-row {
  padding: 4px 16px 4px 24px;
  display: grid;
  grid-template-columns: 36px minmax(180px, 1.5fr) minmax(150px, 1.3fr) minmax(130px, 1fr) minmax(140px, 1.2fr) 118px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  cursor: pointer;
  transition: background 0.1s ease;
  border-radius: 4px;
}

.density-compact .contact-row {
  min-height: 40px;
}

.contact-row:hover {
  background: var(--bg-hover);
}

.contact-row.selected {
  background: #e8f0fe;
}

.row-check-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.row-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-blue);
  cursor: pointer;
  opacity: 0;
  position: absolute;
  z-index: 2;
  transition: opacity 0.1s ease;
}

.contact-row:hover .row-checkbox,
.contact-row.selected .row-checkbox,
.has-selection .row-checkbox {
  opacity: 1;
}

.contact-row:hover .row-avatar,
.contact-row.selected .row-avatar,
.has-selection .row-avatar {
  opacity: 0;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  flex-shrink: 0;
  overflow: hidden;
  user-select: none;
}

.density-compact .avatar-circle.row-avatar {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cell-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  color: var(--text-primary);
}

.cell-muted {
  color: var(--text-secondary);
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.contact-row:hover .row-actions,
.contact-row.is-fav .row-actions .btn-star-row {
  opacity: 1;
}

.contact-row:hover .row-actions {
  opacity: 1;
}

.star-active {
  color: var(--accent-blue);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 24px;
  min-height: 420px;
}

.empty-three-box {
  width: 220px;
  height: 160px;
  margin-bottom: 12px;
}

.empty-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.empty-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 0 22px 0;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Buttons */
.btn-primary {
  height: 40px;
  padding: 0 22px;
  border: none;
  border-radius: 20px;
  background: var(--accent-blue);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-tonal {
  height: 40px;
  padding: 0 20px;
  border: none;
  border-radius: 20px;
  background: var(--bg-active-pill);
  color: var(--accent-on-pill);
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-tonal:hover {
  background: #b0dbff;
}

.btn-outlined {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--border-card);
  border-radius: 18px;
  background: #ffffff;
  color: var(--accent-blue);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-outlined:hover {
  background: var(--bg-hover);
}

/* Contact Detail View (Screenshot 2) */
.detail-wrap {
  padding: 16px 28px 40px 28px;
  max-width: 980px;
}

.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

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

.detail-hero {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 8px 0 20px 12px;
}

.detail-avatar-wrap {
  position: relative;
  width: 152px;
  height: 152px;
  flex-shrink: 0;
}

.detail-avatar {
  width: 152px;
  height: 152px;
  border-radius: 50%;
  font-size: 56px;
  font-weight: 400;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-avatar-add {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  background: var(--bg-active-pill);
  color: var(--accent-on-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.detail-avatar-add:hover {
  background: #addbff;
}

.detail-identity {
  flex: 1;
  min-width: 0;
}

.detail-name {
  font-size: 28px;
  font-weight: 400;
  margin: 0 0 6px 0;
  color: var(--text-primary);
  word-break: break-word;
}

.detail-job {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0 0 18px 0;
}

.detail-quick-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 16px;
}

.quick-action-btn {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 0;
}

.quick-action-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.quick-action-btn.enabled .quick-action-circle {
  background: #e8f0fe;
  color: var(--accent-blue);
}

.quick-action-btn:hover .quick-action-circle {
  background: var(--bg-active-pill);
  color: var(--accent-on-pill);
}

.detail-labels-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  margin-bottom: 18px;
}

.label-chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-add-label-chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #747775;
  background: #ffffff;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-add-label-chip:hover {
  background: var(--bg-hover);
}

.detail-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0 0 22px 0;
}

.detail-columns {
  display: grid;
  grid-template-columns: minmax(280px, 440px) 1fr;
  gap: 32px;
  align-items: start;
}

.info-card {
  background: var(--bg-surface-alt);
  border-radius: 16px;
  padding: 18px 20px;
}

.info-card-title {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 14px 0;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 7px 0;
  font-size: 14px;
}

.info-row .material-symbols-outlined {
  color: var(--text-secondary);
  font-size: 20px;
  margin-top: 1px;
}

.info-row-body {
  flex: 1;
  min-width: 0;
}

.info-val {
  color: var(--text-primary);
  word-break: break-word;
}

.info-sub {
  color: var(--text-secondary);
  font-size: 13px;
}

.history-card {
  padding: 8px 4px;
}

.history-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 12px 0;
}

.history-item {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Edit / Create Form View */
.edit-form-wrap {
  padding: 16px 28px 48px 28px;
  max-width: 720px;
}

.edit-sticky-bar {
  position: sticky;
  top: 0;
  background: #ffffff;
  padding: 8px 0 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  margin-bottom: 20px;
}

.form-section-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.form-row-icon {
  width: 24px;
  margin-top: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.form-fields-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-split {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 10px;
  align-items: center;
}

.m-input, .m-select, .m-textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #747775;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.m-input:focus, .m-select:focus, .m-textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue);
}

.m-textarea {
  min-height: 92px;
  resize: vertical;
}

.btn-add-field {
  align-self: flex-start;
  border: none;
  background: var(--bg-surface-alt);
  color: var(--accent-blue);
  border-radius: 20px;
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-add-field:hover {
  background: #e1eaf6;
}

/* Merge & Fix View (Screenshot 3) */
.suggestions-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  padding: 24px;
  align-items: start;
}

.sug-promo-card {
  border-radius: 16px;
  padding: 16px;
  background: #f8fafd;
  margin-bottom: 12px;
}

.sug-promo-title {
  font-size: 15px;
  font-weight: 500;
  margin: 10px 0 6px 0;
}

.sug-promo-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.sug-filter-card {
  background: var(--bg-active-pill);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-on-pill);
}

.sug-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.sug-list-title {
  font-size: 20px;
  font-weight: 400;
  margin: 0;
}

.dup-pair-card {
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 14px;
  background: #ffffff;
}

.dup-pair-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 12px;
}

.dup-person {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.dup-person-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
}

.dup-person-sub {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dup-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dup-reason {
  font-size: 12px;
  color: var(--text-muted);
}

.dup-card-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-dialog {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-elevated);
}

.modal-dialog.modal-wide {
  max-width: 680px;
}

.modal-title {
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 10px 0;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 18px 0;
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Three.js 3D View Overlay */
.three-overlay {
  position: fixed;
  inset: 0;
  background: #0b1220;
  color: #e8eaed;
  z-index: 120;
  display: flex;
  flex-direction: column;
}

.three-header {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 18, 32, 0.9);
}

.three-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 500;
}

.three-subtitle {
  font-size: 13px;
  color: #9aa0a6;
  font-weight: 400;
}

.three-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.three-controls .icon-btn {
  color: #e8eaed;
}

.three-hint {
  font-size: 12px;
  color: #9aa0a6;
}

.three-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: grab;
}

.three-canvas-wrap:active {
  cursor: grabbing;
}

.three-tooltip {
  position: fixed;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.96);
  color: #1f1f1f;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: var(--shadow-popover);
  z-index: 130;
}

/* Toast Snackbar */
.toast-container {
  position: fixed;
  left: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: #303134;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: var(--shadow-elevated);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Responsive */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 40;
}

@media (max-width: 1120px) {
  .right-panel,
  .right-panel-toggle {
    display: none;
  }
  .contacts-table-head,
  .contact-row {
    grid-template-columns: 36px minmax(160px, 1.5fr) minmax(140px, 1.2fr) minmax(120px, 1fr) 96px;
  }
  .col-job {
    display: none;
  }
  .suggestions-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .workspace {
    padding: 0 8px 8px 8px;
  }
  .topbar-left {
    min-width: auto;
  }
  .brand-title {
    display: none;
  }
  .sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    z-index: 45;
    box-shadow: var(--shadow-elevated);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    width: 272px !important;
    min-width: 272px !important;
    opacity: 1 !important;
  }
  .workspace.mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }
  .contacts-table-head,
  .contact-row {
    grid-template-columns: 36px 1fr 120px 80px;
    padding: 6px 12px;
  }
  .col-email {
    display: none;
  }
  .detail-hero {
    flex-direction: column;
    text-align: center;
    padding-left: 0;
  }
  .detail-quick-actions {
    justify-content: center;
  }
  .detail-columns {
    grid-template-columns: 1fr;
  }
  .dup-pair-grid {
    grid-template-columns: 1fr;
  }
  .three-hint {
    display: none;
  }
}

/* Print */
@media print {
  .topbar, .sidebar, .right-panel, .right-panel-toggle, .dup-banner, .table-tools, .row-actions, .detail-topbar {
    display: none !important;
  }
  .app-shell, .workspace, .main-card, .main-scroll {
    height: auto;
    overflow: visible;
    background: #ffffff;
    padding: 0;
    margin: 0;
  }
}


/* ---------- Advanced Contact Tree (/tree) ---------- */
.tree-workspace {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 540px;
}

.tree-toolbar {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  z-index: 12;
}

.tree-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tree-search-box {
  height: 38px;
  background: var(--bg-search);
  border-radius: 20px;
  display: flex;
  align-items: center;
  padding: 0 8px 0 12px;
  gap: 8px;
  min-width: 240px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.tree-search-box:focus-within {
  background: #ffffff;
  border-color: var(--accent-blue);
}

.tree-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  width: 170px;
}

.tree-search-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

.tree-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.seg-group {
  display: inline-flex;
  background: var(--bg-surface-alt);
  padding: 3px;
  border-radius: 20px;
  gap: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.seg-btn.active {
  background: #ffffff;
  color: var(--accent-blue);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.2);
}

.tree-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #fafbfd;
  background-image: radial-gradient(#dadce0 1px, transparent 1px);
  background-size: 20px 20px;
  cursor: grab;
  user-select: none;
}

.tree-viewport:active {
  cursor: grabbing;
}

.tree-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

.tree-svg-lines {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.tree-edge-path {
  fill: none;
  stroke: #b8c4d4;
  stroke-width: 2;
  transition: stroke 0.15s ease;
}

.tree-edge-path.edge-highlight {
  stroke: var(--accent-blue);
  stroke-width: 2.6;
}

.tree-node-card {
  position: absolute;
  width: 244px;
  background: #ffffff;
  border: 1.5px solid #dadce0;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.1);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
  cursor: pointer;
}

.tree-node-card:hover {
  border-color: #9bb8ea;
  box-shadow: 0 3px 10px rgba(11, 87, 208, 0.12);
}

.tree-node-card.match-highlight {
  border-color: var(--accent-blue);
  background: #f0f6ff;
  box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.15);
}

.tree-node-card.match-active {
  border-color: #0b57d0;
  box-shadow: 0 0 0 4px rgba(11, 87, 208, 0.32);
}

.tree-node-card.drop-target {
  border: 2px dashed var(--accent-blue);
  background: #e8f0fe;
}

.tree-node-accent {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
}

.tree-node-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tree-node-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.tree-node-body {
  flex: 1;
  min-width: 0;
}

.tree-node-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-node-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-rel-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-surface-alt);
  color: var(--accent-on-pill);
}

.tree-node-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #f1f3f4;
}

.tree-node-btn-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tree-mini-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tree-mini-btn:hover {
  background: var(--bg-surface-alt);
  color: var(--accent-blue);
}

.tree-mini-btn .material-symbols-outlined {
  font-size: 16px;
}

.tree-collapse-pill {
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  height: 22px;
  padding: 0 7px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.tree-collapse-pill:hover {
  background: var(--bg-surface-alt);
  color: var(--accent-blue);
}

.tree-zoom-hud {
  position: absolute;
  right: 16px;
  bottom: 16px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  z-index: 15;
}

/* Outline / Folder Tree Mode */
.tree-outline {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 36px 24px;
}

.tree-outline-item {
  margin-bottom: 4px;
}

.tree-outline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
  cursor: pointer;
}

.tree-outline-row:hover {
  background: var(--bg-hover);
}

.tree-outline-row.match-highlight {
  background: #e8f0fe;
  border-color: var(--accent-blue);
}

.tree-outline-row.drop-target {
  border: 2px dashed var(--accent-blue);
  background: #e8f0fe;
}

.tree-outline-children {
  margin-left: 22px;
  padding-left: 14px;
  border-left: 1.5px solid #dadce0;
}

/* Modal Tabs & Presets */
.modal-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-surface-alt);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.modal-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.modal-tab.active {
  background: #ffffff;
  color: var(--accent-blue);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.18);
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.preset-chip {
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.preset-chip:hover {
  background: var(--bg-surface-alt);
  border-color: var(--accent-blue);
}

.color-dots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.color-dot.active {
  border-color: #1f1f1f;
  transform: scale(1.12);
}

@media (max-width: 820px) {
  .tree-toolbar {
    padding: 10px 12px;
  }
  .tree-search-box {
    width: 100%;
  }
  .tree-search-input {
    flex: 1;
  }
}


/* ---------- Quick Filters & Sortable Headers ---------- */
.list-filter-bar {
  padding: 2px 24px 10px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-pill {
  height: 30px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.filter-pill:hover {
  background: var(--bg-hover);
}

.filter-pill.active {
  background: var(--bg-active-pill);
  border-color: var(--bg-active-pill);
  color: var(--accent-on-pill);
}

.az-bar {
  padding: 0 24px 8px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.az-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.az-btn:hover,
.az-btn.active {
  background: var(--bg-active-pill);
  color: var(--accent-on-pill);
}

/* ---------- Tree Breadcrumb & Minimap ---------- */
.tree-breadcrumb-bar {
  padding: 8px 20px;
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.tree-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.tree-crumb-btn {
  border: none;
  background: transparent;
  color: var(--accent-blue);
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 12px;
}

.tree-crumb-btn:hover {
  background: rgba(11, 87, 208, 0.1);
}

.tree-minimap {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: 176px;
  height: 116px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  z-index: 15;
  cursor: crosshair;
}

.tree-minimap-vp {
  position: absolute;
  border: 1.5px solid var(--accent-blue);
  background: rgba(11, 87, 208, 0.1);
  pointer-events: none;
}

/* ---------- Three.js Search & Projected Labels ---------- */
.three-search-input {
  height: 34px;
  width: 220px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 0 14px;
  font-size: 13px;
  outline: none;
}

.three-search-input::placeholder {
  color: #9aa0a6;
}

.three-search-input:focus {
  border-color: #8ab4f8;
  background: rgba(255, 255, 255, 0.14);
}

.three-labels-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.three-label-tag {
  position: absolute;
  transform: translate(-50%, -140%);
  background: rgba(15, 23, 42, 0.82);
  color: #e8eaed;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
}

.three-label-tag.matched {
  background: #0b57d0;
  border-color: #a8c7fa;
  color: #ffffff;
  font-weight: 600;
}

/* ---------- QR Code Box ---------- */
.qr-card {
  background: #ffffff;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto;
}

/* ---------- Material You Dark Theme ---------- */
[data-theme="dark"] {
  --bg-shell: #131314;
  --bg-card: #1e1f20;
  --bg-surface-alt: #282a2c;
  --bg-search: #282a2c;
  --bg-hover: #2d2f31;
  --bg-active-pill: #004a77;
  --bg-banner: #0842a0;
  --text-primary: #e3e3e3;
  --text-secondary: #c4c7c5;
  --text-muted: #9aa0a6;
  --accent-blue: #a8c7fa;
  --accent-blue-hover: #8ab4f8;
  --accent-on-pill: #c2e7ff;
  --border-subtle: #3c4043;
  --border-card: #5f6368;
}

[data-theme="dark"] .brand-title {
  color: #e3e3e3;
}

[data-theme="dark"] .search-box:focus-within {
  background: #303134;
}

[data-theme="dark"] .search-dropdown,
[data-theme="dark"] .popover-menu,
[data-theme="dark"] .modal-dialog,
[data-theme="dark"] .right-panel-toggle,
[data-theme="dark"] .contacts-table-head,
[data-theme="dark"] .selection-bar,
[data-theme="dark"] .edit-sticky-bar,
[data-theme="dark"] .tree-toolbar,
[data-theme="dark"] .dup-pair-card,
[data-theme="dark"] .tree-node-card,
[data-theme="dark"] .tree-zoom-hud,
[data-theme="dark"] .label-chip,
[data-theme="dark"] .btn-add-label-chip,
[data-theme="dark"] .btn-outlined,
[data-theme="dark"] .preset-chip,
[data-theme="dark"] .m-input,
[data-theme="dark"] .m-select,
[data-theme="dark"] .m-textarea,
[data-theme="dark"] .tree-collapse-pill {
  background: #1e1f20;
  color: #e3e3e3;
  border-color: #3c4043;
}

[data-theme="dark"] .account-menu {
  background: #282a2c;
}

[data-theme="dark"] .account-card {
  background: #1e1f20;
}

[data-theme="dark"] .btn-create {
  background: #004a77;
  color: #c2e7ff;
}

[data-theme="dark"] .btn-create:hover {
  background: #005b92;
}

[data-theme="dark"] .btn-primary {
  background: #a8c7fa;
  color: #062e6f;
}

[data-theme="dark"] .btn-primary:hover {
  background: #8ab4f8;
}

[data-theme="dark"] .contact-row.selected {
  background: #004a77;
}

[data-theme="dark"] .tree-viewport {
  background-color: #161718;
  background-image: radial-gradient(#333639 1px, transparent 1px);
}

[data-theme="dark"] .tree-node-card.match-highlight,
[data-theme="dark"] .tree-outline-row.match-highlight {
  background: #0f294a;
  border-color: #a8c7fa;
}

[data-theme="dark"] .tree-edge-path {
  stroke: #4c5157;
}

[data-theme="dark"] .tree-minimap {
  background: rgba(30, 31, 32, 0.92);
}

[data-theme="dark"] .seg-btn.active,
[data-theme="dark"] .modal-tab.active {
  background: #333639;
  color: #a8c7fa;
}

[data-theme="dark"] .sug-promo-card {
  background: #282a2c;
}

[data-theme="dark"] .dup-banner {
  color: #e8f0fe;
}
