/* ============================================================
   마이페이지 레이아웃
   ============================================================ */

.mypage-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 768px) {
  .mypage-layout { grid-template-columns: 1fr; }
}

/* ===== 사이드 네비 ===== */
.mypage-nav {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  overflow: hidden;
  position: sticky;
  top: 86px;
}

@media (max-width: 768px) {
  .mypage-nav { position: static; }
}

.mypage-profile {
  padding: 22px 18px;
  text-align: center;
  background: linear-gradient(135deg, var(--mint-600), var(--mint-800));
  color: #fff;
}
.mypage-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
}
.mypage-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mypage-profile-name {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
}
.mypage-profile-sub {
  font-size: 12px;
  opacity: 0.9;
}
.mypage-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 5px;
  vertical-align: middle;
}
.mypage-badge.admin    { background: #FF6B6B; }
.mypage-badge.agent    { background: var(--success); }
.mypage-badge.pending  { background: var(--warning); }
.mypage-badge.rejected { background: var(--danger); }
.mypage-badge.normal   { background: rgba(255,255,255,0.25); }

.mypage-menu {
  padding: 8px 0;
}
.mypage-menu li {
  list-style: none;
}
.mypage-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 600;
  transition: all .12s;
}
.mypage-menu li a:hover {
  background: var(--gray-50);
  color: var(--primary);
}
.mypage-menu li.active a {
  background: var(--mint-50);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  padding-left: 15px;
}
.m-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.m-count {
  margin-left: auto;
  background: var(--gray-200);
  color: var(--gray-700);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  line-height: 1.5;
}
.m-count.alert {
  background: var(--accent);
  color: #fff;
}
.m-count.pending {
  background: var(--warning);
  color: #fff;
}

.mypage-menu-divider {
  padding: 14px 18px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== 메인 컨텐츠 ===== */
.mypage-content {
  min-width: 0;
}

/* 환영 카드 */
.welcome-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 18px;
  border: 1px solid var(--gray-100);
}
.welcome-card h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.welcome-card p {
  color: var(--gray-500);
  font-size: 14px;
}

.alert-banner {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
}
.alert-banner.pending-banner {
  background: #FEF3C7;
  color: #92400E;
  border-left: 4px solid var(--warning);
}
.alert-banner.rejected-banner {
  background: #FEE2E2;
  color: #991B1B;
  border-left: 4px solid var(--danger);
}
.alert-banner.approved-banner {
  background: #D1FAE5;
  color: #065F46;
  border-left: 4px solid var(--success);
}
.alert-banner a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

/* 통계 그리드 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--gray-100);
  display: flex;
  gap: 14px;
  align-items: center;
  transition: all .15s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.stat-label {
  font-size: 12px;
  color: var(--gray-600);
  font-weight: 600;
  margin-top: 2px;
}
.stat-sub {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* 빠른 액션 */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 768px) { .quick-actions { grid-template-columns: 1fr; } }

.quick-action {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  border: 1px solid var(--gray-100);
  display: flex;
  gap: 14px;
  align-items: center;
  transition: all .15s;
}
.quick-action:hover {
  border-color: var(--primary);
  background: var(--mint-50);
}
.quick-action.primary {
  background: linear-gradient(135deg, var(--mint-600), var(--mint-800));
  color: #fff;
  border-color: transparent;
}
.quick-action.primary:hover { background: linear-gradient(135deg, var(--mint-700), var(--mint-900)); }
.quick-action.accent {
  background: linear-gradient(135deg, #FFA94D, #FF6B6B);
  color: #fff;
  border-color: transparent;
}
.quick-action.accent:hover { background: linear-gradient(135deg, #FF9933, #FF5050); }
.qa-icon { font-size: 28px; flex-shrink: 0; }
.qa-title { font-weight: 700; font-size: 14px; }
.qa-sub { font-size: 11px; opacity: 0.85; margin-top: 2px; }

/* 대시보드 섹션 */
.dashboard-section {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 16px;
  border: 1px solid var(--gray-100);
}
.dashboard-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.dashboard-section h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.3px;
}

.dashboard-table {
  margin: -4px;
  overflow-x: auto;
}
.dashboard-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.dashboard-table th {
  background: var(--gray-50);
  padding: 10px 12px;
  font-weight: 700;
  font-size: 12px;
  color: var(--gray-600);
  text-align: left;
}
.dashboard-table td {
  padding: 11px 12px;
  border-top: 1px solid var(--gray-100);
}
.dashboard-table tr.row-unread { background: var(--mint-50); }

/* 폼 카드 */
.mypage-form-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  border: 1px solid var(--gray-100);
}

/* 프로필 사진 영역 */
.profile-img-row {
  display: flex;
  gap: 18px;
  align-items: center;
}
.profile-img-preview {
  width: 100px;
  height: 100px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--gray-200);
}
.profile-img-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 중개사 통계 */
.agent-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.agent-stat {
  background: var(--mint-50);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.agent-stat .stat-num {
  font-size: 28px;
  color: var(--primary);
}

/* 중개사 전환 혜택 카드 */
.benefit-card {
  background: linear-gradient(135deg, #FFF8E1, #FFFFFF);
  border: 1px solid #FFD580;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 18px;
}
.benefit-card h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 14px;
}
.benefit-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.benefit-card li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
  color: var(--gray-700);
}
.benefit-card li span:first-child {
  font-size: 18px;
  flex-shrink: 0;
}

/* 탈퇴 안내 */
.withdraw-notice {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 18px;
}
.withdraw-notice h3 {
  font-size: 15px;
  font-weight: 700;
  color: #991B1B;
  margin-bottom: 12px;
}
.withdraw-notice ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.withdraw-notice li {
  padding: 4px 0 4px 18px;
  font-size: 13px;
  color: #991B1B;
  position: relative;
}
.withdraw-notice li::before {
  content: '•';
  position: absolute;
  left: 6px;
  font-weight: 700;
}

/* ============================================================
   중개사 찾기
   ============================================================ */

.agent-search-bar {
  display: flex;
  gap: 10px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--gray-100);
}
.agent-search-bar input { flex: 1; font-size: 15px; }

.agent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1024px) { .agent-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .agent-grid { grid-template-columns: 1fr; } }

.agent-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--gray-100);
  transition: all .15s;
}
.agent-card:hover {
  border-color: var(--mint-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.agent-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gray-100);
}
.agent-avatar {
  width: 52px;
  height: 52px;
  background: var(--mint-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  overflow: hidden;
  flex-shrink: 0;
}
.agent-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.agent-name-block {
  flex: 1;
  min-width: 0;
}
.agent-office {
  font-weight: 700;
  color: var(--gray-900);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.agent-verified {
  background: var(--success);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.agent-rep {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

.agent-info { margin-bottom: 16px; }
.agent-info-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.ai-icon { flex-shrink: 0; }

.agent-intro {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--gray-50);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--gray-600);
}

.agent-card-actions {
  display: flex;
  gap: 6px;
}
