/* ===============================
   계정관리 팝업 (중앙 모달)
   PC/모바일: 모두 중앙 팝업 (전체화면 X)
   =============================== */

/* 세부내역서/기타 오버레이(z-index ~10000)보다 위에 표시 */
#accountPage.listing-page,
#teamStaffPage.listing-page {
  z-index: 10100;
}

.team-staff-page__hint {
  margin: 0;
  padding: 8px 16px 0;
  font-size: 13px;
  color: #555;
  line-height: 1.45;
}

#teamStaffPage .account-list-view {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#teamStaffPage .account-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 24px;
}

/* 계정관리·팀원관리: 전체화면 대신 중앙 팝업 */
#accountPage.open,
#teamStaffPage.open {
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#accountPage .listing-backdrop,
#teamStaffPage .listing-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

#accountPage .account-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(920px, calc(100vw - 32px));
  max-height: 85vh;
  min-height: 280px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#teamStaffPage .account-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  min-height: 280px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) {
  #accountPage.open,
  #teamStaffPage.open {
    padding: 12px;
  }
  #accountPage .account-panel,
  #teamStaffPage .account-panel {
    max-height: 90vh;
  }
}

/* 모바일에서도 배경 어둡게 (listing.css의 display:none 오버라이드) */
@media (max-width: 900px) {
  #accountPage .listing-backdrop,
  #teamStaffPage .listing-backdrop {
    display: block;
  }
}

.account-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.account-list-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.account-add-btn-wrap {
  flex-shrink: 0;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 2;
}

/* 공유링크(.slm-tabs)와 같은 시트 탭 */
.account-tabs {
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 4px;
  margin: 0;
  padding: 10px 16px 0;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.account-tabs.hidden {
  display: none !important;
}

.account-tabs__btn {
  appearance: none;
  margin: 0 0 -1px;
  padding: 7px 14px 8px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: #eef2f7;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  cursor: pointer;
}

.account-tabs__btn:hover {
  color: #334155;
  background: #e2e8f0;
}

.account-tabs__btn.is-active {
  background: #fff;
  color: #0f172a;
  border-color: #e2e8f0;
  border-bottom-color: #fff;
  box-shadow: 0 -1px 0 #fff;
}

.account-tabs__btn:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}

.account-tabs__btn.hidden {
  display: none !important;
}

.account-tab-panel[hidden],
.account-tab-panel.hidden {
  display: none !important;
}

.account-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e8eaed;
  position: sticky;
  top: 0;
  z-index: 2;
}

.account-add-btn {
  flex: 1 1 auto;
  width: auto;
  min-height: 44px;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1.5px solid #2563eb;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.account-add-btn:hover {
  background: #dbeafe;
  border-color: #1d4ed8;
}

.account-toolbar.hidden {
  display: none !important;
}

.account-teams-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 24px;
  background: #f8fafc;
}

.account-teams-view.hidden {
  display: none !important;
}

.account-list {
  flex: 0 0 auto;
  overflow: visible;
  padding: 12px 16px 24px;
  background: #f8fafc;
  -webkit-overflow-scrolling: touch;
}

.account-people__section {
  margin-bottom: 16px;
}

.account-people__label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.account-people__count {
  font-weight: 600;
  color: #cbd5e1;
}

.account-people__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 사무실별 폴더 (접기/펴기) — 레거시/트리용 */
.account-folder {
  margin-bottom: 12px;
}

.account-folder__header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: #f0f4ff;
  color: #1a5ae6;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.account-folder__header:hover {
  background: #e3ebff;
}

.account-folder__icon {
  font-size: 10px;
  display: inline-block;
  width: 12px;
}

.account-folder__label {
  flex: 1;
}

.account-folder__count {
  font-size: 12px;
  font-weight: 500;
  color: #666;
}

.account-folder__office {
  font-size: 12px;
  font-weight: 400;
  color: #888;
}

.account-folder__body {
  margin-top: 8px;
  padding-left: 4px;
}

.account-team-block {
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #fbfdff;
  padding: 10px;
  margin-bottom: 10px;
}

.account-team-block__title {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.account-team-block__meta {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}

.account-team-block__manager .account-card {
  border-color: #dbeafe;
  background: #f8fbff;
}

.account-folder__body .account-card {
  margin-bottom: 6px;
}

.account-folder__body .account-card:last-child {
  margin-bottom: 0;
}

.account-empty {
  padding: 28px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  background: #fff;
  border: 1px dashed #e2e8f0;
  border-radius: 14px;
}

.account-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 0;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 0;
  box-shadow: none;
  border: 1px solid #e8edf3;
}

.account-card__info {
  min-width: 0;
  grid-column: 1;
}

.account-card__titleRow {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
}

.account-card__title {
  min-width: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card__badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  background: #f1f5f9;
  color: #64748b;
}

.account-card__badge--owner {
  background: #eef2ff;
  color: #3730a3;
}

.account-card__badge--admin {
  background: #fce7f3;
  color: #9d174d;
}

.account-card__badge--manager {
  background: #eff6ff;
  color: #1d4ed8;
}

.account-card__badge--staff,
.account-card__badge--member {
  background: #f1f5f9;
  color: #64748b;
}

.account-card__meta {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  overflow: hidden;
}

.account-card__meta > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.account-card__metaSep {
  color: #cbd5e1;
  flex-shrink: 0;
}

.account-card__controls {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  align-self: center;
}

.account-card__actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  border: none;
  justify-content: flex-end;
}

.account-card__danger {
  display: flex;
  align-items: center;
  padding-left: 6px;
  margin-left: 0;
  border-left: 1px solid #f1f5f9;
}

.account-card__btn {
  appearance: none;
  margin: 0;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  color: #334155;
  line-height: 1.2;
  white-space: nowrap;
}

.account-card__btn:hover {
  background: #f8fafc;
}

.account-card__btn--edit {
  color: #2563eb;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.account-card__btn--edit:hover {
  background: #dbeafe;
}

.account-card__btn--delete {
  color: #dc2626;
  border-color: transparent;
  background: transparent;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 500;
}

.account-card__btn--delete:hover {
  background: #fef2f2;
  border-color: #fecaca;
}

.account-card__btn--resign {
  color: #b91c1c;
  border-color: transparent;
  background: transparent;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 500;
}

.account-card__btn--resign:hover {
  background: #fef2f2;
  border-color: #fecaca;
}

.account-card__btn--perm {
  color: #0f766e;
  border-color: #99f6e4;
  background: #f0fdfa;
}

.account-card__btn--perm:hover {
  background: #ccfbf1;
}

.account-card__btn--finalize {
  color: #b45309;
  border-color: #fde68a;
  background: #fffbeb;
}

.account-card__inactive {
  flex-shrink: 0;
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #6b7280;
  font-weight: 600;
}

.account-card__phone {
  font-size: 11.5px;
  color: #94a3b8;
}

.account-card__phone::before {
  content: none;
  margin: 0;
}

@media (max-width: 560px) {
  .account-card {
    padding: 9px 10px;
    column-gap: 8px;
  }

  .account-card__btn {
    padding: 4px 8px;
    font-size: 11px;
  }

  .account-card__btn--resign,
  .account-card__btn--delete {
    padding: 3px 4px;
    font-size: 10.5px;
  }
}

/* 레거시 폴더/카드 보조 (단독 트리 등) */
.account-card__top {
  min-width: 0;
}

.account-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.account-card__body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
}

.account-card__identity {
  flex: 1 1 160px;
  min-width: 0;
}

.account-card__sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 4px;
}

.account-card__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.account-card__email {
  font-weight: 600;
  font-size: 15px;
  color: #111;
}

.account-card__name {
  font-size: 13px;
  color: #666;
}

.account-card__grade {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
}

.account-card__office {
  font-size: 12px;
  color: #94a3b8;
  padding: 0;
  background: transparent;
}

.account-card__grade--owner {
  background: #eef2ff;
  color: #3730a3;
}

.account-card__grade--admin {
  background: #fce7f3;
  color: #9d174d;
}

.account-card__grade--manager {
  background: #eff6ff;
  color: #1d4ed8;
}

.account-card__grade--staff,
.account-card__grade--member {
  background: #f1f5f9;
  color: #64748b;
}

.account-card__banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* -------- 폼 뷰 -------- */
.account-form-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
}

.account-form-view.hidden {
  display: none !important;
}

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

.account-form__mode {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.account-form__mode--edit {
  background: #fff7e6;
  color: #8a5a00;
  border: 1px solid #ffd591;
}

.account-form__mode--create {
  background: #e6f4ff;
  color: #0958d9;
  border: 1px solid #91caff;
}

.account-form__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-form__label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.account-form__hint {
  font-weight: 400;
  font-size: 12px;
  color: #888;
}

.account-form__input,
.account-form__select {
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  background: #fff;
}

.account-form__input:focus,
.account-form__select:focus {
  border-color: #2b6cff;
}

.account-form__select {
  cursor: pointer;
}

.account-form__actions {
  flex-shrink: 0;
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

.account-form__cancel,
.account-form__submit {
  flex: 1;
  height: 44px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.account-form__cancel {
  background: #f0f0f0;
  color: #555;
}

.account-form__cancel:hover {
  background: #e0e0e0;
}

.account-form__submit {
  background: #2b6cff;
  color: #fff;
}

.account-form__submit:hover {
  background: #1a5ae6;
}

/* ===============================
   권한 설정 모달 (team/office public)
   =============================== */
/* 계정관리 패널(#accountPage z-index:10100)보다 위 — 안 그러면 모달이 패널 뒤에 깔림 */
#teamCategoryPermissionModal {
  z-index: 10250;
}

#teamCategoryPermissionModal .modal__backdrop {
  background: rgba(15, 23, 42, 0.4);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

#teamCategoryPermissionModal .modal__panel.team-category-perm-modal__panel {
  max-width: 480px;
  width: min(480px, calc(100% - 32px));
  border-radius: 16px;
  border: none;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  background: #fff;
}

#teamCategoryPermissionModal .team-category-perm-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 0;
  border-bottom: none;
}

#teamCategoryPermissionModal .team-category-perm-modal__header .modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

#teamCategoryPermissionModal .team-category-perm-modal__x {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

#teamCategoryPermissionModal .team-category-perm-modal__x:hover {
  background: #e2e8f0;
  color: #334155;
}

#teamCategoryPermissionModal .team-category-perm-modal__body {
  padding: 14px 18px 8px;
  background: #f8fafc;
}

#teamCategoryPermissionModal .team-category-perm-modal__section {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

#teamCategoryPermissionModal .team-category-perm-modal__section-title {
  margin: 0 0 12px 0;
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
  letter-spacing: -0.02em;
}

#teamCategoryPermissionModal .team-category-perm-modal__row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

#teamCategoryPermissionModal .team-category-perm-modal__row--stack {
  gap: 6px;
}

#teamCategoryPermissionModal .team-category-perm-modal__subtitle {
  min-width: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
}

#teamCategoryPermissionModal .team-category-perm-modal__hint {
  font-size: 12px;
  line-height: 1.45;
  color: #94a3b8;
}

#teamCategoryPermissionModal .team-category-perm-modal__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

#teamCategoryPermissionModal .team-category-perm-modal__cats label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  color: #334155;
}

#teamCategoryPermissionModal .team-category-perm-modal__cats input {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

#teamCategoryPermissionModal .team-category-perm-modal__teamList {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-category-perm-modal__teamRow {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}

.team-category-perm-modal__teamRow-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.team-category-perm-modal__teamRow-title {
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
}

.team-category-perm-modal__catLine {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.team-category-perm-modal__catLine label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 9px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 12.5px;
  color: #334155;
}

.team-category-perm-modal__catLine input {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

#teamCategoryPermissionModal .team-category-perm-modal__footer {
  padding: 14px 18px 18px;
  display: flex;
  gap: 10px;
  border-top: none;
  background: #fff;
}

#teamCategoryPermissionModal .team-category-perm-modal__save,
#teamCategoryPermissionModal .team-category-perm-modal__close {
  flex: 1;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
}

#teamCategoryPermissionModal .team-category-perm-modal__save {
  background: #2563eb;
  color: #fff;
  border: 1px solid #2563eb;
}

#teamCategoryPermissionModal .team-category-perm-modal__save:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

#teamCategoryPermissionModal .team-category-perm-modal__close {
  background: #fff;
  color: #334155;
  border: 1px solid #e2e8f0;
}

#teamCategoryPermissionModal .team-category-perm-modal__close:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* 대표 — 팀 설정 */
.account-teams-section {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.account-teams-section.hidden {
  display: none;
}

.account-teams-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.account-teams-section__title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.account-teams-section__add {
  padding: 8px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.account-teams-section__add:hover {
  background: #dbeafe;
}

.account-teams-section__desc {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 10px;
  box-shadow: inset 3px 0 0 #93c5fd;
}

.account-teams-section__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.account-teams-empty {
  margin: 0 0 10px;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  background: #fff;
  border: 1px dashed #e2e8f0;
  border-radius: 12px;
}

.account-teams-empty--hint {
  border-style: solid;
  background: #f8fafc;
}

.account-teams-list {
  display: grid;
  gap: 10px;
}

.account-teams-empty {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.account-teams-empty--hint {
  margin-top: 6px;
  font-size: 12px;
}

.account-team-panel {
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.account-team-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.account-team-panel__name-wrap {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
}

.account-team-panel__name {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.account-team-panel__rename,
.account-team-panel__delete {
  flex-shrink: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.account-team-panel__rename {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
}

.account-team-panel__delete {
  border: 1px solid #fecaca;
  background: #fff;
  color: #b91c1c;
}

.account-team-panel__section + .account-team-panel__section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.account-team-panel__subtitle {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.account-team-panel__count {
  font-weight: 500;
  color: #64748b;
}

.account-team-panel__members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.account-team-panel__none {
  font-size: 12px;
  color: #94a3b8;
}

.account-team-member {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 12px;
  color: #334155;
}

.account-team-member__remove {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.account-team-picker {
  display: flex;
  gap: 8px;
}

.account-team-picker__select {
  flex: 1;
  min-width: 0;
}

.account-team-picker__add {
  flex-shrink: 0;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.account-team-panel__empty {
  margin: 0 0 8px;
  font-size: 12px;
  color: #94a3b8;
}

/* 계정관리 단독 팝업: 패널 폭 */
@media (max-width: 720px) {
  #accountPage .account-panel {
    max-width: calc(100vw - 24px);
  }

  #accountPage .account-list-view {
    overflow-x: hidden;
  }
}

/* 사무실 단위 트리 연결선 (목록 구분용) */
#accountPage .account-list.account-office-tree {
  position: relative;
  padding-left: 32px;
}

#accountPage .account-list.account-office-tree::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 22px;
  bottom: 22px;
  width: 2px;
  border-radius: 1px;
  background: #c7d2fe;
}

#accountPage .account-list.account-office-tree > .account-folder {
  position: relative;
  margin-bottom: 16px;
}

#accountPage .account-list.account-office-tree > .account-folder:last-child {
  margin-bottom: 0;
}

#accountPage .account-list.account-office-tree > .account-folder::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 20px;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: #93c5fd;
}

#accountPage .account-list.account-office-tree > .account-folder::after {
  content: "";
  position: absolute;
  left: -19px;
  top: 17px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #60a5fa;
  box-sizing: border-box;
}

/* 사무실이 하나뿐이면 연결선 숨김 */
#accountPage .account-list.account-office-tree:has(> .account-folder:only-child) {
  padding-left: 16px;
}

#accountPage .account-list.account-office-tree:has(> .account-folder:only-child)::before,
#accountPage .account-list.account-office-tree > .account-folder:only-child::before,
#accountPage .account-list.account-office-tree > .account-folder:only-child::after {
  display: none;
}

/* 계정관리: 사무실 → 팀 → 매니저/직원 중첩 카드 */
#accountPage .account-folder__body {
  margin-top: 8px;
  padding-left: 0;
}

#accountPage .account-office-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
}

#accountPage .account-office-card__section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#accountPage .account-office-card__label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 2px;
}

#accountPage .account-office-card__count {
  font-weight: 500;
  color: #94a3b8;
}

#accountPage .account-office-card__section--owner .account-card {
  border-color: #ddd6fe;
  background: #faf5ff;
}

#accountPage .account-team-card {
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #fff;
}

#accountPage .account-team-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

#accountPage .account-team-card__title {
  font-size: 13px;
  font-weight: 700;
  color: #1e40af;
}

#accountPage .account-team-card__meta {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
}

#accountPage .account-team-card__managers,
#accountPage .account-team-card__staff {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#accountPage .account-team-card__managers .account-card {
  border-color: #bfdbfe;
  background: #f8fbff;
}

#accountPage .account-team-card__staff {
  margin-top: 4px;
  padding-left: 12px;
}

#accountPage .account-team-card__staff .account-card {
  border-color: #e5e7eb;
  background: #fafafa;
}

#accountPage .account-office-card .account-card:last-child,
#accountPage .account-team-card__managers .account-card:last-child,
#accountPage .account-team-card__staff .account-card:last-child {
  margin-bottom: 0;
}
