/* 3차 static/style.css 이식본 (본문 무변경). 4차 추가분은 파일 끝에. */
/* ===== Reset & Variables ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-primary: #2D8B4E;
  --color-primary-light: #E8F5EE;
  --color-primary-dark: #1A5C33;
  --color-green: #2D8B4E;
  --color-blue: #3B7DD8;
  --color-amber: #D4890B;
  --color-red: #D93B3B;
  --color-bg: #F5F5F0;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F9F9F6;
  --color-border: #E2E2DC;
  --color-border-light: #EEEEEA;
  --color-text: #1A1A1A;
  --color-text-secondary: #6B6B65;
  --color-text-muted: #9B9B95;
  --sidebar-width: 280px;
  --header-height: 56px;
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  font-size: 14px;
  min-height: 100vh;
}

/* ===== Page Management ===== */
.page {
  display: none;
  height: 100vh;
}
.page.active {
  display: flex;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--color-primary);
  color: white;
}
.btn-primary:hover {
  background: var(--color-primary-dark);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}
.btn-outline:hover {
  background: var(--color-surface-alt);
}
.btn-full { width: 100%; }
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}
.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--transition);
}
.btn-icon:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}
.btn-text {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.btn-text:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}
.btn-text-sm {
  background: none;
  border: none;
  font-size: 12px;
  cursor: pointer;
  color: var(--color-blue);
  padding: 2px 6px;
  border-radius: 4px;
}
.btn-text-sm:hover { text-decoration: underline; }
.btn-text-sm.danger { color: var(--color-red); }

/* ===== Login Page ===== */
.login-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--color-bg);
  box-sizing: border-box;
}
.login-card {
  width: 100%;
  max-width: 480px;
  background: var(--color-surface);
  padding: 32px 32px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.logo-icon {
  font-size: 40px;
  margin-bottom: 8px;
}
.login-logo h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-primary);
}
.login-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}
.form-group input:focus {
  border-color: var(--color-primary);
}
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  background: #fff;
  transition: border-color var(--transition);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-group select:focus {
  border-color: var(--color-primary);
}
.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
.pw-hint-card {
  background: var(--color-bg);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.pw-hint-title {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted, #aaa);
  margin-bottom: 6px;
}
.pw-hint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 16px;
}
.pw-hint-item {
  font-size: 12px;
  color: var(--color-text-muted, #999);
}
.login-divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
}
.login-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--color-border);
}
.login-divider span {
  background: var(--color-surface);
  padding: 0 12px;
  position: relative;
  color: var(--color-text-muted);
  font-size: 13px;
}
.login-link {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--color-text-secondary);
}
.login-link a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

/* ===== Chat Layout ===== */
.chat-layout {
  display: flex;
  width: 100%;
  height: 100vh;
}

/* ===== Sidebar (리디자인) ===== */
.sidebar {
  width: 250px;
  min-width: 200px;
  max-width: 500px;
  background: var(--color-surface-alt);
  border-right: 1px solid var(--color-border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
}
.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
  z-index: 10;
  transition: background 0.15s;
}
.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
  background: var(--color-primary);
}
.sidebar-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sb-logo-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--color-primary-light);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.logo-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary);
}
.sb-new-btn {
  width: 30px; height: 30px; border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-secondary); cursor: pointer;
  transition: all var(--transition);
}
.sb-new-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* 단지 뱃지 */
.sb-apt-section { padding: 0 12px 12px; }
.sb-apt-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius);
  background: var(--color-primary-light);
  font-size: 13px; color: var(--color-primary-dark);
}
.sb-apt-icon { font-size: 14px; }

.sidebar-section {
  padding: 12px 12px 8px;
  min-height: 0;
}
.sidebar-section.chat-section {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: 0;
}
.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  padding: 0 4px;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
}
.chat-item {
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition);
}
.chat-item:hover { background: var(--color-surface); }
.chat-item.active {
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 500;
}
.chat-item-icon { font-size: 14px; flex-shrink: 0; }
.chat-item-text {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-item-delete {
  margin-left: auto;
  background: none; border: none;
  color: var(--color-text-secondary);
  font-size: 12px; cursor: pointer;
  opacity: 0; padding: 2px 5px;
  border-radius: 4px;
  transition: opacity var(--transition), background var(--transition);
}
.chat-item:hover .chat-item-delete { opacity: 0.6; }
.chat-item-delete:hover {
  opacity: 1 !important;
  background: rgba(0,0,0,0.08);
  color: #d32f2f;
}

/* 사이드바 푸터 */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--color-border-light);
  flex-shrink: 0;
}
.sb-user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 4px 8px;
}
.sb-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.sb-user-info { display: flex; flex-direction: column; min-width: 0; }
.sb-user-name { font-size: 13px; font-weight: 500; color: var(--color-text); }
.sb-user-role {
  font-size: 11px; color: var(--color-text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sb-links { display: flex; gap: 4px; flex-wrap: wrap; }
.sb-link {
  font-size: 12px; color: var(--color-text-secondary);
  padding: 4px 8px; border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer; border: 1px solid var(--color-border-light);
  transition: all var(--transition);
  text-decoration: none;
}
.sb-link:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ===== Chat Main (리디자인) ===== */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--color-surface);
}
.chat-header {
  height: var(--header-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-border-light);
  flex-shrink: 0;
}
.chat-header h2 {
  font-size: 15px;
  font-weight: 500;
}
.chat-logout-btn {
  background: none; border: 1px solid var(--color-border);
  border-radius: 6px; padding: 5px 12px;
  font-size: 12px; color: var(--color-text-secondary);
  cursor: pointer; transition: var(--transition);
}
.chat-logout-btn:hover { border-color: #9CA3AF; color: #111827; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Welcome (리디자인 — 2x2 카드 그리드) */
.welcome-message {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-secondary);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex: 1;
}
.welcome-icon-wrap {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--color-primary-light);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.welcome-leaf { font-size: 24px; }
.welcome-message h3 {
  font-size: 18px; font-weight: 500;
  color: var(--color-text); margin-bottom: 6px;
}
.welcome-message p {
  font-size: 14px; margin-bottom: 24px; line-height: 1.6;
}
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 460px;
  width: 100%;
}
.quick-card {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: left; cursor: pointer;
  display: flex; align-items: flex-start; gap: 10px;
  line-height: 1.4;
  transition: all var(--transition);
}
.quick-card:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.quick-card-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.quick-card-text { display: flex; flex-direction: column; gap: 2px; }
.quick-card-title { font-size: 13px; font-weight: 600; color: var(--color-text); }
.quick-card-sub { font-size: 11px; color: var(--color-text-muted); font-weight: 400; }

/* Messages (리디자인) */
.message {
  display: flex;
  gap: 10px;
  max-width: 580px;
}
.message.user {
  flex-direction: row-reverse;
  margin-left: auto;
}
.message-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.user-avatar-msg {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}
.bot-avatar-msg {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.message-content {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.7;
}
.message.user .message-content {
  background: var(--color-primary);
  color: white;
  border-bottom-right-radius: 4px;
}
.message.bot .message-content {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
  border-bottom-left-radius: 4px;
}

/* 답변 텍스트 */
.chat-answer-text {
  font-size: 14px; line-height: 1.75; margin: 0;
  color: var(--color-text);
}

/* 실천 팁 카드 */
.chat-tip-card {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #FFF8E1;
  border: 1px solid #F1E0A6;
}
.chat-tip-label {
  font-size: 12px; font-weight: 600;
  color: #854F0B; margin-bottom: 4px;
}
.chat-tip-text {
  font-size: 13px; color: #6B5500;
  line-height: 1.55; margin: 0;
}

/* 출처 (muted 텍스트 + 가운뎃점) */
.chat-source-row {
  margin-top: 10px;
  font-size: 11px;
  color: var(--color-text-muted);
  display: flex; align-items: center;
  gap: 4px; flex-wrap: wrap;
}
.chat-source-item { color: var(--color-text-muted); }
.chat-source-sep { color: var(--color-text-muted); font-size: 11px; }

/* 법령 (muted 한 줄) */
.chat-law-text {
  margin-top: 4px;
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* 추천 질문 */
.chat-suggest {
  margin-top: 12px;
}
.chat-suggest-label {
  font-size: 12px; color: var(--color-text-muted);
  margin-bottom: 6px;
}
.chat-suggest-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.chat-suggest-btn {
  font-size: 12px; padding: 5px 12px;
  border-radius: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.chat-suggest-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}
.typing-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-text-muted);
  animation: typing 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}

/* Chat Input */
.chat-input-area {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--color-border-light);
}
.chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 16px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition);
}
.chat-input-wrapper:focus-within {
  border-color: var(--color-primary);
}
#chat-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  padding: 8px 0;
}
.send-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--color-primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.send-btn:hover {
  background: var(--color-primary-dark);
}
.input-hint {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 8px;
  text-align: center;
}

/* ===== Admin Layout ===== */
/* ═══════════════════════════════════════════
   최종관리자 대시보드 — Admin Dashboard
   목업 기준: dm-* 스타일 (미니멀, border 기반, 그림자 없음)
   ═══════════════════════════════════════════ */
.admin-layout {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #FFFFFB;
}

/* ── 헤더 ── */
.admin-header {
  height: var(--header-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.admin-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-header-left h2 {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text);
}
.admin-header-left .btn-icon {
  color: var(--color-text-secondary);
  margin-right: 4px;
}
.admin-header-left .btn-icon:hover { color: var(--color-text); }

/* ── 탭 ── */
.admin-tabs {
  display: flex;
  gap: 0;
}
.admin-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.admin-tab:hover {
  color: var(--color-text);
}
.admin-tab.active {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
  font-weight: 500;
}
.ad-tab-badge {
  display: inline-block;
  background: #FCEBEB;
  color: #A32D2D;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
  vertical-align: middle;
}
.ad-region-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: #EAF3DE;
  color: #3B6D11;
  font-size: 11px;
  font-weight: 500;
}
.ad-plain-section {
  margin-bottom: 24px;
}
.ad-section-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 10px;
}

/* ── 콘텐츠 영역 ── */
.admin-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}
.admin-content.hidden {
  display: none;
}

/* ── 통계 카드 ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 0.5px solid var(--color-border);
}
.stat-card {
  padding: 14px 16px;
  border: none;
  background: none;
}
.stat-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
  display: block;
}
.stat-value {
  font-size: 22px;
  font-weight: 500;
  color: var(--color-text);
}
.stat-value.green { color: #3B6D11; }
.stat-value.blue { color: #185FA5; }
.stat-value.amber { color: var(--color-amber); }
.stat-value.red { color: #A32D2D; }
.stat-change {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.stat-change.up { color: #3B6D11; }

/* ── 섹션 카드 ── */
.stats-section {
  background: var(--color-surface);
  padding: 16px;
  border-radius: 12px;
  border: 0.5px solid var(--color-border);
  margin-bottom: 16px;
}
.stats-section h3 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--color-text);
}

/* Region Bars */
.region-stats { display: flex; flex-direction: column; gap: 10px; }
.region-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.region-bar-label {
  font-size: 13px;
  width: 70px;
  flex-shrink: 0;
  color: var(--color-text-secondary);
}
.region-bar-track {
  flex: 1;
  height: 6px;
  background: var(--color-surface-alt);
  border-radius: 3px;
  overflow: hidden;
}
.region-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.region-bar-value {
  font-size: 13px;
  font-weight: 500;
  width: 40px;
  text-align: right;
}

/* ── 테이블 ── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-secondary);
  border-bottom: 0.5px solid var(--color-border);
}
.admin-table td {
  padding: 10px;
  font-size: 13px;
  border-bottom: 0.5px solid var(--color-border);
  color: var(--color-text);
}
.admin-table tbody tr:hover {
  background: var(--color-surface-alt);
}

/* ── 문서 관리 ── */
.doc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.doc-filters {
  display: flex;
  gap: 8px;
}
.filter-select {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--color-surface);
  outline: none;
}

/* Badges & Tags */
.type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.type-badge.guide { background: #EAF3DE; color: #3B6D11; }
.type-badge.law { background: #E6F1FB; color: #185FA5; }
.type-badge.policy { background: #FFF3E0; color: #8B5E0B; }

.region-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.region-tag.seoul { background: #EAF3DE; color: #3B6D11; }
.region-tag.cheonan { background: #E6F1FB; color: #185FA5; }
.region-tag.busan { background: #FFF3E0; color: #8B5E0B; }
.region-tag.common { background: var(--color-surface-alt); color: var(--color-text-secondary); }

.vector-status {
  font-size: 11px;
  font-weight: 500;
}
.vector-status.done { color: #3B6D11; }
.vector-status.pending { color: var(--color-amber); }

.status-active {
  color: #3B6D11;
  font-size: 12px;
  font-weight: 500;
}
.status-inactive {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 500;
}

/* Stats Columns (side by side) */
.stats-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* Placeholder text */
.stat-placeholder {
  color: var(--color-text-muted);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

/* Top Questions List */
.top-questions-list {
  display: flex;
  flex-direction: column;
}
.top-question-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-light);
}
.top-question-item:last-child { border-bottom: none; }
.top-question-rank {
  color: #3B6D11;
  font-weight: 600;
  font-size: 13px;
  min-width: 18px;
}
.top-question-text {
  flex: 1;
  font-size: 13px;
  color: var(--color-text);
}
.top-question-count {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Daily Trend Chart */
.daily-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-top: 20px;
}
.daily-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.daily-bar-count {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-weight: 500;
}
.daily-bar {
  width: 100%;
  background: #3B6D11;
  border-radius: 3px 3px 0 0;
  min-height: 4px;
}
.daily-bar-label {
  font-size: 11px;
  color: var(--color-text-muted);
}
.daily-bar-label.today {
  color: var(--color-text);
  font-weight: 600;
}

/* Index Status */
.index-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
}
.index-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
}
.index-dot.active {
  background: #3B6D11;
}

/* ===== Landing Page ===== */
.landing {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #FAFAF8;
  overflow-y: auto;
}

/* Nav */
.land-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 40px;
  background: #fff;
  border-bottom: 2px solid var(--color-primary);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.land-nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.land-logo-icon { font-size: 22px; }
.land-logo-text { font-size: 17px; font-weight: 600; color: var(--color-text); }
.land-badge {
  font-size: 11px;
  padding: 2px 10px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-radius: 4px;
  font-weight: 500;
  margin-left: 4px;
}
.land-nav-links {
  display: flex;
  gap: 24px;
}
.land-nav-links a {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}
.land-nav-links a:hover { color: var(--color-text); }
.land-nav-right {
  display: flex;
  gap: 8px;
}

/* Hero */
.land-hero {
  text-align: center;
  padding: 48px 60px 36px;
  background: linear-gradient(180deg, #F0FAF4 0%, #FAFAF8 100%);
}
.land-hero h1 {
  font-size: 32px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  margin-bottom: 12px;
}
.land-accent { color: var(--color-primary); }
.land-hero p {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}
.land-hero-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.btn-lg {
  padding: 10px 28px;
  font-size: 14px;
}

/* Notice */
.land-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 40px;
  background: #FFF8E1;
  border-bottom: 1px solid #F0E4B8;
  font-size: 12px;
  color: #8B5E0B;
  flex-shrink: 0;
}
.land-notice svg { flex-shrink: 0; stroke: #D4890B; }

/* Features */
.land-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 24px 40px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.land-feat {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.land-feat:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 12px rgba(45, 139, 78, 0.08);
  transform: translateY(-2px);
}
.land-feat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}
.land-feat h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}
.land-feat p {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Bottom 2-col */
.land-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 0 40px 28px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.land-card {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.land-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.land-regions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.land-region {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #FAFAF8;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
}
.land-region:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}
.land-region-go {
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 500;
}
.land-rdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}
.land-info-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.land-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}
.land-info-row svg { flex-shrink: 0; }
.land-info-row div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.land-info-row strong {
  color: var(--color-text);
}
.land-info-row span { font-size: 12px; color: var(--color-text-muted); }

/* Footer */
.land-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 40px;
  border-top: 1px solid var(--color-border-light);
  font-size: 11px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  background: #fff;
  margin-top: auto;
}
.land-footer-links {
  display: flex;
  gap: 20px;
}
.land-footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.land-footer-links a:hover { color: var(--color-text-secondary); }

/* Nav avatar */
.land-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--color-primary-light); color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: opacity var(--transition);
}
.land-avatar:hover { opacity: 0.8; }
.btn-ghost {
  background: transparent; border: none; color: var(--color-text-secondary);
  font-size: 14px; cursor: pointer; text-decoration: none; padding: 6px 10px;
  font-family: inherit; transition: color var(--transition);
}
.btn-ghost:hover { color: var(--color-text); }

/* Community section on landing */
.land-community-section {
  max-width: 1200px; margin: 0 auto; width: 100%;
  padding: 0 40px 28px;
}
.land-community {
  background: #fff; border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg); padding: 24px 28px;
  overflow: hidden;
}
.land-community-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 12px;
}
.land-community-title {
  display: flex; align-items: center; gap: 14px;
}
.land-community-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--color-primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.land-community-title h2 {
  font-size: 17px; font-weight: 600; color: var(--color-text); margin: 0;
}
.land-community-sub {
  font-size: 13px; color: var(--color-text-secondary); margin-top: 2px; display: block;
}
.land-community-actions {
  display: flex; gap: 8px; flex-shrink: 0;
}

/* Community post list */
.land-community-posts {
  border-top: 1px solid var(--color-border-light);
}
.land-community-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 6px; border-bottom: 1px solid var(--color-border-light);
}
.land-community-row-left {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
}
.land-badge-cat {
  font-size: 11px; padding: 3px 8px; border-radius: 4px;
  background: var(--color-primary-light); color: var(--color-primary-dark);
  font-weight: 500; white-space: nowrap; flex-shrink: 0;
}
.land-community-post-title {
  font-size: 14px; color: var(--color-text); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.land-community-post-title:hover { color: var(--color-primary); }
.land-community-row-right {
  display: flex; gap: 12px; font-size: 12px; color: var(--color-text-muted);
  white-space: nowrap; flex-shrink: 0; margin-left: 16px;
}
.land-community-empty {
  text-align: center; padding: 24px; color: var(--color-text-muted); font-size: 14px;
}

/* Community CTA (비로그인) */
.land-community-cta {
  text-align: center; padding: 40px 32px;
}
.land-community-cta-icon {
  font-size: 48px; margin-bottom: 16px;
}
.land-community-cta h2 {
  font-size: 18px; font-weight: 600; color: var(--color-text); margin: 0 0 8px;
}
.land-community-cta p {
  font-size: 14px; color: var(--color-text-secondary); margin-bottom: 20px;
}

/* ===== Guide Page ===== */
.guide-layout {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #FAFAF8;
}
.guide-content {
  flex: 1;
  overflow-y: auto;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 0 48px;
}
.guide-header {
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  margin: 28px 0 24px;
}
.guide-header h1 {
  font-size: 26px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}
.guide-header p {
  font-size: 14px;
  color: var(--color-text-secondary);
}
.guide-sections-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.guide-section {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 0;
}
.guide-section.full-width {
  grid-column: 1 / -1;
}
.guide-section h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border-light);
}
.guide-section ul {
  list-style: none;
  padding: 0;
}
.guide-section li {
  font-size: 14px;
  color: var(--color-text-secondary);
  padding: 7px 0;
  padding-left: 18px;
  position: relative;
  line-height: 1.6;
}
.guide-section li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: 600;
}
.guide-cta {
  text-align: center;
  padding: 28px 0 36px;
}
.guide-cta p {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-bottom: 14px;
}

/* ===== Service Page ===== */
.service-hero {
  text-align: center;
  padding: 40px 0 28px;
}
.service-hero h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}
.service-hero p {
  font-size: 15px;
  color: var(--color-text-secondary);
}
.service-section {
  margin-bottom: 24px;
}
.service-section h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
}
.service-section p {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}
.service-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.service-feat-card {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.service-feat-num {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
}
.service-feat-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}
.service-feat-card p {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.service-topics {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.service-topic {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
}
.service-topic svg { flex-shrink: 0; }
.service-topic strong {
  font-size: 14px;
  color: var(--color-text);
  display: block;
  margin-bottom: 2px;
}
.service-topic span {
  font-size: 12px;
  color: var(--color-text-muted);
}
.service-cta {
  text-align: center;
  padding: 28px 0 32px;
  margin-top: 8px;
  border-top: 1px solid var(--color-border-light);
}
.service-cta h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}
.service-cta p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

/* Upload Section */
.upload-section {
  margin-top: 24px;
}
.upload-area {
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--color-surface);
}
.upload-area:hover,
.upload-area.drag-over {
  border-color: #3B6D11;
  background: #F6FAF0;
}
.upload-icon {
  margin-bottom: 12px;
  color: var(--color-text-muted);
}
.upload-area:hover .upload-icon,
.upload-area.drag-over .upload-icon {
  color: #3B6D11;
}
.upload-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 4px;
}
.upload-hint {
  font-size: 12px;
  color: var(--color-text-muted);
}
.upload-progress {
  margin-top: 12px;
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.upload-progress.hidden {
  display: none;
}
.upload-progress-bar {
  height: 4px;
  background: #3B6D11;
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0;
  flex: 1;
}
.upload-progress-text {
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }


/* ═══════════ 4차 추가분 ═══════════ */
/* Django Form 검증 에러 */
.form-hint {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--color-text-muted, #999);
  line-height: 1.6;
}
.form-hint li { list-style: disc; }
.form-error { color: #c0392b; font-size: 12.5px; margin: 4px 0 0; }
.form-errors-top { background: #FDECEA; border: 1px solid #F5C6C0; color: #c0392b;
  border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
/* 플래시 메시지 (업로드 완료 등) */
.flash { border-radius: 8px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 14px; }
.flash.success { background: #E8F5EE; border: 1px solid #BDE3CC; color: #1F6B3A; }
.flash.warning { background: #FFF8E1; border: 1px solid #F1E0A6; color: #8A6D0B; }
.flash.error   { background: #FDECEA; border: 1px solid #F5C6C0; color: #c0392b; }
/* 문서 목록·업로드 (admin-table, upload-area 재사용 + 여백만) */
.docs-wrap { max-width: 880px; margin: 0 auto; padding: 24px 20px 60px; flex: 1; overflow-y: auto; width: 100%; }
.docs-head { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 14px; }
.docs-head h1 { font-size: 22px; margin: 0; }
.doc-actions { display: flex; gap: 8px; }
.doc-pre { background: #fff; border: 1px solid #e5e5e5; border-radius: 10px;
  padding: 18px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.7; }
.profile-rows { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 18px; }
.profile-row { display: flex; justify-content: space-between; font-size: 14px;
  border-bottom: 1px solid #f0f0f0; padding-bottom: 8px; }
.profile-row span:first-child { color: #888; }

/* ══════════════════════════════════════════════════════════
   마이페이지 (mp-* prefix)
   ══════════════════════════════════════════════════════════ */
.mp-layout { min-height: 100vh; background: #F9FAFB; display: flex; justify-content: center; padding: 32px 16px; }
.mp-container { width: 100%; max-width: 720px; }

/* 헤더 */
.mp-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.mp-back { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 50%; background: #fff; border: 1px solid #E5E7EB; color: #6B7280; text-decoration: none; }
.mp-back:hover { background: #F3F4F6; }
.mp-title { font-size: 20px; font-weight: 600; color: #111827; }

/* 프로필 상단 */
.mp-profile-top { display: flex; align-items: center; gap: 16px; background: #fff;
  border-radius: 12px; padding: 20px 24px; border: 1px solid #E5E7EB; margin-bottom: 0; }
.mp-avatar { width: 52px; height: 52px; border-radius: 50%; background: #E1F5EE;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600; color: #0F6E56; flex-shrink: 0; }
.mp-name { font-size: 16px; font-weight: 500; color: #111827; }
.mp-email { font-size: 13px; color: #6B7280; margin-top: 2px; }

/* 탭 바 */
.mp-tabs { display: flex; gap: 0; background: #fff; border-left: 1px solid #E5E7EB;
  border-right: 1px solid #E5E7EB; border-bottom: 1px solid #E5E7EB; overflow-x: auto; }
.mp-tab { flex: 1; padding: 12px 0; font-size: 13px; font-weight: 400; color: #6B7280;
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; transition: color .15s, border-color .15s; white-space: nowrap; }
.mp-tab.active { color: #0F6E56; font-weight: 500; border-bottom-color: #0F6E56; }
.mp-tab:hover:not(.active) { color: #374151; }

/* 패널 */
.mp-panel { display: none; background: #fff; border-left: 1px solid #E5E7EB;
  border-right: 1px solid #E5E7EB; border-bottom: 1px solid #E5E7EB;
  border-radius: 0 0 12px 12px; padding: 20px 24px; }
.mp-panel.active { display: block; }

/* 내 정보 */
.mp-info-rows { display: flex; flex-direction: column; gap: 0; margin-bottom: 16px; }
.mp-info-row { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid #F3F4F6; }
.mp-info-row:last-child { border-bottom: none; }
.mp-info-label { font-size: 13px; color: #6B7280; }
.mp-info-value { font-size: 13px; color: #111827; }

/* 내 단지 */
.mp-apt-current { background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px; }
.mp-apt-label { font-size: 11px; color: #6B7280; margin-bottom: 4px; }
.mp-apt-name { font-size: 15px; font-weight: 500; color: #111827; }
.mp-apt-role-badge { display: inline-block; font-size: 11px; padding: 2px 10px;
  border-radius: 10px; background: #E1F5EE; color: #0F6E56; margin-top: 6px; }
.mp-apt-list-title { font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 10px; }
.mp-apt-card { background: #F9FAFB; border: 1px solid #E5E7EB; border-radius: 10px;
  padding: 12px 16px; margin-bottom: 8px; }
.mp-apt-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mp-apt-card-name { font-size: 14px; font-weight: 500; color: #111827; }
.mp-apt-card-meta { font-size: 12px; color: #6B7280; margin-top: 2px; }
.mp-apt-card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.mp-apt-actions-bottom { margin-top: 12px; }
.mp-apt-shortcuts { margin-top: 8px; }
.mp-shortcut-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* 공용 소형 버튼 */
.mp-btn-sm { display: inline-block; font-size: 12px; padding: 5px 14px; border-radius: 6px;
  border: 1px solid #D1D5DB; background: #fff; color: #374151; cursor: pointer;
  text-decoration: none; line-height: 1.4; }
.mp-btn-sm:hover { background: #F3F4F6; }
.mp-btn-danger { color: #DC2626; border-color: #FECACA; }
.mp-btn-danger:hover { background: #FEF2F2; }

/* 활동 내역 */
.mp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.mp-stat { background: #F9FAFB; border-radius: 10px; padding: 14px; text-align: center; border: 1px solid #E5E7EB; }
.mp-stat-num { font-size: 22px; font-weight: 600; color: #111827; }
.mp-stat-label { font-size: 11px; color: #6B7280; margin-top: 2px; }
.mp-act-pills { display: flex; gap: 6px; margin-bottom: 14px; }
.mp-act-pill { font-size: 12px; padding: 5px 14px; border-radius: 20px; border: 1px solid #E5E7EB;
  background: #F9FAFB; color: #6B7280; cursor: pointer; }
.mp-act-pill.active { background: #E1F5EE; color: #0F6E56; border-color: #5DCAA5; }
.mp-act-sub { display: none; }
.mp-act-sub.active { display: block; }
.mp-act-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #F3F4F6;
  text-decoration: none; color: inherit; }
.mp-act-item:last-child { border-bottom: none; }
.mp-act-item:hover { background: #FAFAFA; }
.mp-act-icon { width: 28px; height: 28px; border-radius: 8px; background: #F3F4F6;
  display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.mp-act-body { flex: 1; min-width: 0; }
.mp-act-title { font-size: 13px; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-act-date { font-size: 11px; color: #9CA3AF; margin-top: 2px; }

/* 설정 */
.mp-settings-section { padding: 12px 0; }
.mp-settings-title { font-size: 14px; font-weight: 500; color: #111827; margin-bottom: 4px; }
.mp-settings-desc { font-size: 12px; color: #6B7280; margin-bottom: 8px; }
.mp-settings-value { font-size: 13px; color: #111827; margin-bottom: 8px; }
.mp-settings-divider { height: 1px; background: #F3F4F6; margin: 4px 0; }
.mp-settings-links { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mp-settings-link { font-size: 13px; color: #374151; text-decoration: none; }
.mp-settings-link:hover { color: #0F6E56; }
.mp-settings-link-primary { font-weight: 600; text-decoration: underline; color: #111827 !important; }
.mp-settings-link-primary:hover { color: #0F6E56 !important; }
.mp-text-danger { color: #DC2626 !important; }

/* 안내 메모 */
.mp-note { font-size: 12px; line-height: 1.6; border-radius: 8px; padding: 10px 14px; margin-top: 14px; }
.mp-note strong { font-weight: 600; }
.mp-note-info { background: #EFF6FF; border-left: 3px solid #3B82F6; color: #1E40AF; }
.mp-note-warning { background: #FFFBEB; border-left: 3px solid #F59E0B; color: #92400E; }

/* 빈 상태 */
.mp-empty { font-size: 13px; color: #9CA3AF; text-align: center; padding: 24px 0; }

/* 커뮤니티 게시판 (docs-wrap·admin-table 재사용 + 아래만 추가) */

/* ── 게시판 전용 넓은 레이아웃 ── */
.board-wrap { width: 100%; padding: 32px 60px 60px; }
.board-wrap .docs-head { margin: 12px 0 20px; }
.board-wrap .docs-head h1 { font-size: 24px; }

/* ── 게시판 테이블 ── */
.board-wrap .admin-table th { font-size: 13px; padding: 12px 14px; }
.board-wrap .admin-table td { font-size: 14px; padding: 12px 14px; }
.board-wrap .admin-table th:nth-child(1),
.board-wrap .admin-table td:nth-child(1) { width: 45%; }   /* 제목 */
.board-wrap .admin-table th:nth-child(2),
.board-wrap .admin-table td:nth-child(2) { width: 13%; }   /* 작성자 */
.board-wrap .admin-table th:nth-child(3),
.board-wrap .admin-table td:nth-child(3) { width: 14%; }   /* 지역 */
.board-wrap .admin-table th:nth-child(4),
.board-wrap .admin-table td:nth-child(4) { width: 10%; text-align: center; }  /* 조회 */
.board-wrap .admin-table th:nth-child(5),
.board-wrap .admin-table td:nth-child(5) { width: 18%; text-align: right; }   /* 작성일 */
.board-wrap .admin-table td a { color: var(--color-text); text-decoration: none; }
.board-wrap .admin-table td a:hover { color: var(--color-primary); }

.board-filter { display: flex; gap: 10px; margin-bottom: 18px; }
.board-filter input[type="text"] { flex: 1; padding: 10px 14px; border: 1px solid var(--color-border);
  border-radius: var(--radius); font-size: 14px; outline: none; }
.board-filter input[type="text"]:focus { border-color: var(--color-primary); }
.board-filter .region-dropdown { min-width: 160px; padding: 10px 36px 10px 14px;
  border: 1px solid var(--color-border); border-radius: var(--radius); font-size: 14px;
  outline: none; background: #fff; -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.board-filter .region-dropdown:focus { border-color: var(--color-primary); }

/* ── 게시글 상세 ── */
.board-wrap .board-meta { color: #888; font-size: 13.5px; margin: -6px 0 16px; }
.board-wrap .board-meta em { font-style: normal; color: #aaa; }
.board-wrap .board-attach { font-size: 14px; margin: 0 0 14px; }
.board-wrap .doc-pre { font-size: 14px; line-height: 1.8; padding: 24px; }

.paging { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 24px; font-size: 14px; }
.paging a { color: var(--color-primary); text-decoration: none; }
.paging a:hover { text-decoration: underline; }
.paging-now { color: #888; }

/* ── 글쓰기 폼 ── */
.board-form-card { max-width: 720px; }
.form-group textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--color-border);
  border-radius: var(--radius); font-size: 14px; outline: none; resize: vertical;
  font-family: inherit; line-height: 1.6; transition: border-color var(--transition); }
.form-group textarea:focus { border-color: var(--color-primary); }

/* ===== Apartment Community Layout ===== */

/* -- Header -- */
.comm-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.comm-header-left h1 {
  font-size: 20px; font-weight: 600; margin: 0; color: var(--color-text);
}
.comm-header-left h1 span { color: var(--color-primary); }
.comm-header-sub {
  font-size: 13px; color: var(--color-text-secondary); margin: 4px 0 0;
}
.comm-search {
  position: relative;
}
.comm-search input {
  padding: 7px 12px 7px 32px; font-size: 13px; width: 220px;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  outline: none; background: var(--color-surface);
}
.comm-search input:focus { border-color: var(--color-primary); }
.comm-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--color-text-muted);
}

/* -- Category pills + sort row -- */
.comm-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.comm-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.comm-pill {
  padding: 5px 16px; border-radius: 20px; font-size: 13px;
  text-decoration: none; cursor: pointer; transition: all 0.15s;
  background: var(--color-bg); border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}
.comm-pill:hover { border-color: var(--color-primary); color: var(--color-primary); }
.comm-pill.active {
  background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}
.comm-pill.pill-question { border-color: #B5D4F4; color: #185FA5; background: #E6F1FB; }
.comm-pill.pill-question.active { background: #185FA5; color: #fff; border-color: #185FA5; }
.comm-pill.pill-info { border-color: #9FE1CB; color: #0F6E56; background: #E1F5EE; }
.comm-pill.pill-info.active { background: #0F6E56; color: #fff; border-color: #0F6E56; }
.comm-pill.pill-review { border-color: #FAC775; color: #854F0B; background: #FAEEDA; }
.comm-pill.pill-review.active { background: #854F0B; color: #fff; border-color: #854F0B; }
.comm-pill.pill-free { border-color: #CECBF6; color: #534AB7; background: #EEEDFE; }
.comm-pill.pill-free.active { background: #534AB7; color: #fff; border-color: #534AB7; }
.comm-sort {
  padding: 7px 12px; font-size: 13px;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  background: var(--color-surface); outline: none;
}

/* -- Card grid -- */
.comm-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.comm-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 12px; padding: 16px 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.comm-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(45,139,78,0.08);
}

.comm-card-badges { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.badge {
  padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 500;
  display: inline-block;
}
.badge-hidden { background: #F3F4F6; color: #6B7280; border: 1px solid #D1D5DB; }
.badge-hot { background: #FAECE7; color: #993C1D; }
.badge-question { background: #E6F1FB; color: #185FA5; }
.badge-info { background: #E1F5EE; color: #0F6E56; }
.badge-review { background: #FAEEDA; color: #854F0B; }
.badge-free { background: #EEEDFE; color: #534AB7; }

.comm-card-title {
  font-size: 15px; font-weight: 500; margin: 0 0 6px; color: var(--color-text);
  line-height: 1.4;
}
.comm-card-preview {
  font-size: 13px; color: var(--color-text-secondary); margin: 0 0 12px;
  line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.comm-card-footer {
  display: flex; align-items: center; justify-content: space-between;
}
.comm-card-author { display: flex; align-items: center; gap: 6px; }
.comm-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: #E1F5EE; color: #0F6E56;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500; flex-shrink: 0;
}
.comm-author-name { font-size: 12px; color: var(--color-text-secondary); }
.comm-card-date { font-size: 12px; color: var(--color-text-muted); }
.comm-card-stats {
  display: flex; gap: 10px; font-size: 12px; color: var(--color-text-muted);
}

.comm-empty {
  text-align: center; padding: 60px 20px; color: var(--color-text-muted); font-size: 14px;
  grid-column: 1 / -1;
}

/* -- Pagination -- */
.comm-paging {
  display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: 24px;
}
.comm-page-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); font-size: 13px; text-decoration: none;
  color: var(--color-text-secondary); border: 1px solid var(--color-border);
  background: var(--color-surface); transition: all 0.15s;
}
.comm-page-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.comm-page-btn.active {
  background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}

/* legacy aliases for detail page */
.community-card-badges { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.community-card-author { display: flex; align-items: center; gap: 6px; }
.community-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: #E1F5EE; color: #0F6E56;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; flex-shrink: 0;
}
.community-author-name { font-size: 12px; color: var(--color-text-secondary); }
.community-card-date { font-size: 12px; color: var(--color-text-muted); }

/* -- More menu (⋮) -- */
.detail-more-menu {
  display: none; position: absolute; right: 0; top: 100%; margin-top: 4px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  min-width: 120px; z-index: 20; overflow: hidden;
}
.detail-more-menu.show { display: block; }
.detail-more-item {
  display: block; width: 100%; padding: 10px 16px; font-size: 13px;
  text-decoration: none; color: var(--color-text); background: none;
  border: none; cursor: pointer; text-align: left; font-family: inherit;
  transition: background 0.12s;
}
.detail-more-item:hover { background: var(--color-bg); }
.detail-more-danger { color: #c0392b; }
.detail-more-danger:hover { background: #FFF0F0; }

/* ===== Detail Page ===== */
.detail-header { margin-bottom: 20px; }
.detail-title { font-size: 22px; font-weight: 600; margin: 8px 0 12px; line-height: 1.4; }
.detail-meta {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.detail-meta-info { font-size: 12px; color: var(--color-text-muted); }
.detail-content {
  padding: 20px 0; border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  font-size: 15px; line-height: 1.8; white-space: pre-wrap;
  margin-bottom: 16px; min-height: 100px;
}

.detail-actions { margin-bottom: 24px; }
.like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px; border-radius: 20px; font-size: 14px;
  border: 1px solid var(--color-border); background: var(--color-surface);
  cursor: pointer; transition: all 0.15s; text-decoration: none;
  color: var(--color-text-secondary);
}
.like-btn:hover { border-color: #e74c3c; color: #e74c3c; }
.like-btn.liked { border-color: #e74c3c; color: #e74c3c; background: #FFF0F0; }

/* ===== Comments ===== */
.comment-section { border-top: 1px solid var(--color-border); padding-top: 20px; }
.comment-title { font-size: 16px; font-weight: 600; margin: 0 0 16px; }
.comment-form { margin-bottom: 20px; }
.comment-input-wrap {
  display: flex; gap: 10px; align-items: flex-start;
}
.comment-textarea {
  flex: 1; padding: 10px 14px; border: 1px solid var(--color-border);
  border-radius: var(--radius); font-size: 14px; font-family: inherit;
  resize: none; outline: none; line-height: 1.5;
}
.comment-textarea:focus { border-color: var(--color-primary); }
.comment-form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.comment-login-prompt {
  padding: 14px; text-align: center; font-size: 13px;
  color: var(--color-text-secondary); background: var(--color-bg);
  border-radius: var(--radius); margin-bottom: 16px;
}
.comment-login-prompt a { color: var(--color-primary); font-weight: 500; }

.comment-list { display: flex; flex-direction: column; gap: 0; }
.comment-item {
  padding: 14px 0; border-bottom: 1px solid var(--color-border);
}
.comment-item-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.comment-body { font-size: 14px; line-height: 1.6; margin: 0; color: var(--color-text); }
.comment-delete-btn {
  background: none; border: none; font-size: 12px;
  color: var(--color-text-muted); cursor: pointer;
}
.comment-delete-btn:hover { color: #c0392b; }
.comment-empty { text-align: center; padding: 20px; color: var(--color-text-muted); font-size: 13px; }

/* (기존 response-law-notice, response-suggestions, response-apartment-sources 는
   chat.js 리디자인에서 chat-law-text, chat-suggest, chat-source-row 로 대체됨) */

/* ═══ 회원가입 리디자인 ═══ */
.signup-card { max-width: 580px; }
.su-section { margin-bottom: 22px; }
.su-section-title {
  font-size: 14px; font-weight: 700; color: #111827;
  margin-bottom: 14px; padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border-light);
}
.su-hint {
  font-size: 12px; color: var(--color-text-muted);
  margin-top: 4px;
}
/* 토글 라디오 */
.su-radio-toggle {
  display: flex; gap: 8px;
}
.su-radio-opt {
  flex: 1; text-align: center;
  padding: 8px 0; border-radius: 6px;
  border: 1px solid var(--color-border);
  font-size: 13px; font-weight: 500; color: #374151;
  cursor: pointer; transition: var(--transition);
}
.su-radio-opt input { display: none; }
.su-radio-opt:hover { border-color: var(--color-primary); }
.su-radio-opt.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  font-weight: 600;
}
/* 마이페이지 로그아웃 버튼 */
.mp-logout-top-btn {
  background: none; border: 1px solid var(--color-border);
  border-radius: 6px; padding: 6px 14px;
  font-size: 13px; color: #374151;
  cursor: pointer; transition: var(--transition);
}
.mp-logout-top-btn:hover { border-color: #9CA3AF; color: #111827; }

/* ═══ 중간관리자 대시보드 ═══ */
.md-wrap { width: 100%; max-width: 900px; margin: 0 auto; padding: 32px 40px 60px; }
.md-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px;
}
.md-title { font-size: 22px; font-weight: 600; }
.md-subtitle { font-size: 13px; color: #6B7280; margin-top: 4px; }
.md-back-link { font-size: 13px; color: #6B7280; text-decoration: none; }
.md-back-link:hover { color: var(--color-primary); }
.md-stats { display: flex; gap: 12px; margin-bottom: 28px; }
.md-stat-card {
  flex: 1; background: var(--color-surface-alt); border: 1px solid var(--color-border-light);
  border-radius: 10px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.md-stat-label { font-size: 12px; color: #6B7280; }
.md-stat-value { font-size: 22px; font-weight: 600; color: #111827; }
.md-stat-accent { color: var(--color-blue); }
.md-stat-warning { color: var(--color-amber); }
.md-section { margin-bottom: 28px; }
.md-section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.md-empty { font-size: 13px; color: #9CA3AF; text-align: center; padding: 24px 0; }
.md-btn-danger { color: #DC2626 !important; border-color: #FCA5A5 !important; }
.md-btn-danger:hover { background: #FEF2F2 !important; }
.md-rule-badge { display:inline-block; padding:2px 8px; border-radius:4px; background:#E8F5E9; color:#2E7D32; font-size:12px; font-weight:600; }

.form-errors-top {
  background: #FEF2F2; border: 1px solid #FECACA;
  color: #991B1B; border-radius: 6px;
  padding: 10px 14px; margin-bottom: 16px; font-size: 13px;
}
