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

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

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

#accountPage .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: 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 {
    padding: 12px;
  }
  #accountPage .account-panel {
    max-height: 90vh;
  }
}

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

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

.account-list-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.account-add-btn {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 2px solid #2b6cff;
  border-radius: 10px;
  background: rgba(43, 108, 255, 0.05);
  color: #2b6cff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.account-add-btn:hover {
  background: rgba(43, 108, 255, 0.12);
  border-color: #1a5ae6;
}

.account-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 24px;
  -webkit-overflow-scrolling: touch;
}

/* 사무실별 폴더 (접기/펴기) */
.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: 8px;
}

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

.account-empty {
  padding: 24px 16px;
  text-align: center;
  color: #888;
  font-size: 14px;
}

.account-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid #eee;
}

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

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

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

.account-card__inactive {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
}

.account-card__grade {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.account-card__office {
  font-size: 12px;
  color: #666;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f5f5f5;
}

.account-card__grade--owner {
  background: #ede9fe;
  color: #5b21b6;
}

.account-card__grade--admin {
  background: #e8f0fe;
  color: #1a5ae6;
}

.account-card__grade--manager {
  background: #e8f5e9;
  color: #2e7d32;
}

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

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

.account-card__actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.account-card__btn {
  padding: 6px 12px;
  font-size: 13px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: #f0f0f0;
  color: #333;
}

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

.account-card__btn--edit {
  background: #e8f0fe;
  color: #1a5ae6;
}

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

.account-card__btn--delete {
  background: #ffebee;
  color: #c62828;
}

.account-card__btn--delete:hover {
  background: #ffcdd2;
}

.account-card__btn--resign {
  background: #fff7ed;
  color: #b45309;
}

.account-card__btn--resign:hover {
  background: #ffedd5;
}

.account-card__btn--perm {
  background: rgba(37, 99, 235, 0.08);
  color: #1a5ae6;
}

.account-card__btn--perm:hover {
  background: rgba(37, 99, 235, 0.14);
}

/* -------- 폼 뷰 -------- */
.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__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)
   =============================== */
#teamCategoryPermissionModal .modal__panel.team-category-perm-modal__panel {
  max-width: 520px;
  width: 92vw;
}

#teamCategoryPermissionModal .team-category-perm-modal__body {
  padding: 16px;
}

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

#teamCategoryPermissionModal .team-category-perm-modal__section-title {
  margin: 0 0 10px 0;
  font-weight: 700;
  font-size: 14px;
  color: #111;
}

#teamCategoryPermissionModal .team-category-perm-modal__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

#teamCategoryPermissionModal .team-category-perm-modal__subtitle {
  min-width: 150px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

#teamCategoryPermissionModal .team-category-perm-modal__cats label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
  font-size: 13px;
}

#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 #eee;
  border-radius: 10px;
  padding: 10px;
  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: #111;
}

.team-category-perm-modal__catLine label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
  font-size: 12.5px;
}

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

#teamCategoryPermissionModal .team-category-perm-modal__footer {
  padding: 12px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #e5e7eb;
}

#teamCategoryPermissionModal .team-category-perm-modal__save {
  padding: 8px 16px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#teamCategoryPermissionModal .team-category-perm-modal__save:hover {
  opacity: 0.92;
}
