.panel-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.sidebar-header {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  outline: none;
  width: auto;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }

.btn-refresh {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.btn-refresh:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-refresh.spinning { animation: spin 1s linear infinite; }

/* Selected summary bar */
.selected-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(0,168,132,0.12);
  border-bottom: 1px solid rgba(0,168,132,0.25);
  font-size: 12px;
  color: var(--green-light);
  flex-shrink: 0;
}
.selected-bar.visible { display: flex; }
.btn-clear-all {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 11px; padding: 0;
}
.btn-clear-all:hover { color: var(--red); }

.contact-sections {
  overflow-y: auto;
  flex: 1;
  padding-bottom: 8px;
  min-height: 0;
}

/* Section header — clickable to collapse */
.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 1;
}
.section-label:hover { color: var(--text-primary); }

.section-label-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-arrow {
  font-size: 9px;
  transition: transform 0.2s;
  display: inline-block;
}
.section-label.collapsed .section-arrow {
  transform: rotate(-90deg);
}

.section-count {
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
}

.contact-list {
  list-style: none;
  padding: 0 6px;
  overflow: hidden;
}
.contact-list.collapsed { display: none; }

/* Compact contact item */
.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
  min-height: 36px;
}
.contact-item:hover { background: var(--bg-tertiary); }
.contact-item.selected { background: rgba(0, 168, 132, 0.15); }

.contact-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-group { background: #2d2f5a; color: #7b86e2; }

.contact-info { flex: 1; overflow: hidden; }
.contact-name {
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.contact-check {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
  transition: all 0.1s;
}
.contact-item.selected .contact-check {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.contact-item.selected .contact-check::after { content: '✓'; }

/* Add phone number section */
.add-number-section { padding: 0 10px 10px; }
.add-number-section.collapsed { display: none; }

.phone-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.phone-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
}
.phone-input:focus { border-color: var(--green); }
.phone-input::placeholder { color: var(--text-muted); }

.btn-add-phone {
  width: 100%;
  padding: 7px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-add-phone:hover { opacity: 0.85; }

.avatar-newsletter { background: #3d1f5a; color: #c084fc; }
