/* ==========================================================================
   프렌즈공인중개사사무소 관리자 대시보드 (Friends Real Estate Admin Dashboard)
   Design System: Dark Glassmorphism, Bricolage Grotesque, Pretendard, High Contrast
   ========================================================================== */

:root {
  --admin-bg: #090A0D;
  --admin-surface: #121418;
  --admin-surface-card: #181B22;
  --admin-surface-elevated: #20242D;
  --admin-border: rgba(255, 255, 255, 0.12);
  --admin-border-focus: #FF8D03;
  --admin-text-primary: #FFFFFF;
  --admin-text-secondary: #9CA3AF;
  --admin-text-muted: #6B7280;
  
  --admin-accent: #FF8D03;
  --admin-accent-hover: #FFA231;
  --admin-accent-glow: rgba(255, 141, 3, 0.28);
  
  --admin-success: #10B981;
  --admin-success-subtle: rgba(16, 185, 129, 0.16);
  --admin-danger: #EF4444;
  --admin-danger-subtle: rgba(239, 68, 68, 0.16);
  --admin-warning: #F59E0B;
  --admin-warning-subtle: rgba(245, 158, 11, 0.16);
  --admin-info: #0284C7;
  --admin-info-subtle: rgba(2, 132, 199, 0.16);

  --font-display: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;
  
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--admin-bg);
  color: var(--admin-text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --- Container & Layout --- */
.admin-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-header {
  height: 72px;
  background: rgba(14, 16, 22, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--admin-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--admin-text-primary);
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #FF8D03, #D97000);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  box-shadow: 0 4px 14px var(--admin-accent-glow);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-text .admin-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: rgba(255, 141, 3, 0.2);
  color: var(--admin-accent);
  border: 1px solid rgba(255, 141, 3, 0.4);
}

.brand-text p {
  font-size: 0.76rem;
  color: var(--admin-text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.78rem;
  font-weight: 600;
  color: #34D399;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

.btn-header-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid var(--admin-border);
  background: var(--admin-surface-card);
  color: var(--admin-text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-header-action:hover {
  background: var(--admin-surface-elevated);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #F87171;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #EF4444;
  color: #FFF;
}

/* --- Main Layout --- */
.admin-main {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* --- Stats Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-accent, var(--admin-accent));
}

.stat-card.total { --stat-accent: #FF8D03; }
.stat-card.active { --stat-accent: #10B981; }
.stat-card.completed { --stat-accent: #EF4444; }
.stat-card.pending { --stat-accent: #F59E0B; }

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--admin-text-secondary);
}

.stat-icon {
  font-size: 1.25rem;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--admin-text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-desc {
  font-size: 0.76rem;
  color: var(--admin-text-muted);
}

/* --- Action & Filter Toolbar --- */
.admin-toolbar {
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 300px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--admin-text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 40px;
  font-size: 0.88rem;
  color: var(--admin-text-primary);
  font-family: inherit;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px var(--admin-accent-glow);
}

.filter-select {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.86rem;
  color: var(--admin-text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.filter-select:focus {
  outline: none;
  border-color: var(--admin-accent);
}

.filter-select option {
  background: var(--admin-surface-card);
  color: var(--admin-text-primary);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--admin-accent);
  color: #000000;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px var(--admin-accent-glow);
}

.btn-primary-action:hover {
  background: var(--admin-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--admin-accent-glow);
}

.btn-secondary-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--admin-surface-elevated);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary-action:hover {
  background: var(--admin-surface);
  border-color: rgba(255, 255, 255, 0.25);
}

/* --- Properties Table View --- */
.table-card {
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.admin-table thead {
  background: rgba(14, 16, 22, 0.8);
  border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
  padding: 14px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-text-secondary);
  white-space: nowrap;
}

.admin-table td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: background var(--transition-fast);
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.prop-cell-media {
  display: flex;
  align-items: center;
  gap: 14px;
}

.prop-thumb {
  width: 68px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #111;
  border: 1px solid var(--admin-border);
  flex-shrink: 0;
}

.prop-info-title {
  font-weight: 700;
  color: var(--admin-text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.prop-info-sub {
  font-size: 0.78rem;
  color: var(--admin-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.table-badge.sale { background: rgba(255, 141, 3, 0.2); color: #FF8D03; }
.table-badge.rent { background: rgba(2, 132, 199, 0.2); color: #38BDF8; }
.table-badge.jeonse { background: rgba(16, 185, 129, 0.2); color: #34D399; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.status-pill.active {
  background: rgba(16, 185, 129, 0.16);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-pill.completed {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-pill.pending {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-pill:hover {
  transform: scale(1.04);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--admin-surface-elevated);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-table-action:hover {
  background: var(--admin-surface);
  color: var(--admin-text-primary);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-table-action.edit:hover {
  color: var(--admin-accent);
  border-color: var(--admin-accent);
}

.btn-table-action.delete:hover {
  color: #EF4444;
  border-color: #EF4444;
}

.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--admin-text-secondary);
}

.empty-state svg {
  margin-bottom: 16px;
  color: var(--admin-text-muted);
}

/* --- Modals --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.admin-modal-card {
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 880px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  transform: translateY(20px);
  transition: transform var(--transition-normal);
  overflow: hidden;
}

.modal-overlay.active .admin-modal-card {
  transform: translateY(0);
}

.modal-head {
  padding: 20px 28px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--admin-surface-card);
  z-index: 10;
}

.modal-head h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
}

.modal-close-icon {
  background: none;
  border: none;
  color: var(--admin-text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFF;
}

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
}

.modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--admin-accent);
}

.modal-foot {
  padding: 16px 28px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
  background: var(--admin-surface-card);
  z-index: 10;
}

/* --- Form Fields --- */
.form-section-title {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--admin-accent);
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--admin-border);
}

.form-section-title:first-child {
  margin-top: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--admin-text-secondary);
  margin-bottom: 6px;
}

.form-label .req {
  color: var(--admin-danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 0.88rem;
  color: var(--admin-text-primary);
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px var(--admin-accent-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* --- Image Upload Dropzone --- */
.image-upload-box {
  background: var(--admin-surface);
  border: 2px dashed var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  position: relative;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.image-upload-box.dragover {
  border-color: var(--admin-accent);
  background: rgba(255, 141, 3, 0.05);
}

.upload-preview-area {
  display: flex;
  align-items: center;
  gap: 20px;
}

.upload-preview-img {
  width: 140px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--admin-border);
  background: #000;
}

.upload-preview-details {
  flex: 1;
  text-align: left;
}

.upload-preset-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.preset-chip {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--admin-surface-elevated);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-chip:hover {
  background: var(--admin-accent);
  color: #000;
  border-color: var(--admin-accent);
}

/* --- Login Overlay --- */
.login-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, #1c1f2b 0%, #0a0b0e 100%);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: rgba(22, 25, 33, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-xl);
  max-width: 440px;
  width: 100%;
  padding: 38px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8), 0 0 50px rgba(255, 141, 3, 0.12);
  text-align: center;
}

.login-brand-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #FF8D03, #D97000);
  color: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px var(--admin-accent-glow);
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.86rem;
  color: var(--admin-text-secondary);
  margin-bottom: 28px;
}

.login-hint {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.78rem;
  color: var(--admin-text-muted);
  margin-top: 18px;
}

/* --- Toast --- */
.admin-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #000;
  color: #FFF;
  border: 1px solid var(--admin-accent);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-header {
    height: auto;
    padding: 12px 0;
  }
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 0 16px;
  }
  .header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
  }
  .btn-header-action {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  .sync-status-indicator {
    font-size: 0.74rem;
    padding: 4px 8px;
  }
  .admin-main {
    padding: 16px 12px 40px;
  }
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-overlay {
    padding: 8px !important;
    align-items: flex-end !important;
  }
  .admin-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    max-height: 94vh !important;
    border-radius: var(--radius-lg) !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .modal-head {
    padding: 16px 18px !important;
    flex-shrink: 0 !important;
  }
  .modal-body {
    padding: 18px 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .modal-foot {
    padding: 14px 16px !important;
    flex-direction: column-reverse !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    background: var(--admin-surface-card) !important;
  }
  .modal-foot .btn-primary-action,
  .modal-foot .btn-secondary-action {
    width: 100% !important;
    justify-content: center !important;
    padding: 14px !important;
    font-size: 0.95rem !important;
  }
  .form-control, .form-select, .form-textarea, input, select, textarea {
    font-size: 16px !important; /* Prevents auto-zoom in iOS Safari */
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .form-row, .form-row.three-col {
    grid-template-columns: 1fr;
  }
  .toolbar-left, .toolbar-right {
    width: 100%;
  }
  .btn-primary-action, .btn-secondary-action {
    flex: 1;
    justify-content: center;
  }
}

/* =========================================================================
   Consultations & Tabs UI (Option C)
   ========================================================================= */
.admin-tab-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--admin-text-secondary);
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-nav-btn:hover {
  color: var(--admin-text-primary);
  background: var(--admin-surface-card);
  border-color: rgba(255, 255, 255, 0.22);
}

.tab-nav-btn.active {
  color: #FFFFFF;
  background: var(--admin-surface-card);
  border-color: var(--admin-accent);
  box-shadow: 0 4px 14px var(--admin-accent-glow);
}

.badge-new-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: #EF4444;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-left: 2px;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.badge-track-buy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: rgba(255, 141, 3, 0.16);
  color: #FF8D03;
  border: 1px solid rgba(255, 141, 3, 0.35);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-track-sell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.16);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.phone-action-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-phone-call {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.14);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-phone-call:hover {
  background: #10B981;
  color: #000;
  transform: translateY(-1px);
}

.btn-copy-num {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #D1D5DB;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.76rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy-num:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #FFF;
}

.consult-status-select {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.consult-status-select.status-new {
  color: #10B981;
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.1);
}

.consult-status-select.status-contacted {
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.1);
}

.consult-status-select.status-pending {
  color: #F59E0B;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
}

.consult-status-select.status-deal {
  color: #A855F7;
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.1);
}

.consult-message-box {
  max-width: 320px;
  font-size: 0.84rem;
  color: #D1D5DB;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.consult-message-box:hover {
  color: #FFF;
  text-decoration: underline;
}

/* --- Members Management & Activity Modal Styles --- */
.btn-table-action.btn-view-member {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #C084FC;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-table-action.btn-view-member:hover {
  background: #A855F7;
  color: #FFFFFF;
  border-color: #A855F7;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.4);
  transform: translateY(-1px);
}

.badge-member-wish {
  font-size: 0.74rem;
  font-weight: 800;
  color: #EC4899;
  background: rgba(236, 72, 153, 0.14);
  border: 1px solid rgba(236, 72, 153, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-member-inq {
  font-size: 0.74rem;
  font-weight: 800;
  color: #10B981;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* =========================================================================
   Mobile & Multi-Device Responsive Styles (스마트폰/태블릿 최적화)
   ========================================================================= */

@media (max-width: 768px) {
  /* Admin App Layout */
  .admin-app {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--admin-border);
    padding: 14px 18px;
  }

  .admin-main {
    padding: 16px;
  }

  .admin-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
  }

  /* Form Rows */
  .form-row,
  .form-row.three-col {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Modal Cards for Mobile */
  .modal-overlay {
    padding: 10px;
    align-items: flex-end;
  }

  .admin-modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .modal-head {
    padding: 14px 18px;
  }

  .modal-head h3 {
    font-size: 1.05rem;
  }

  .modal-body {
    padding: 16px;
    max-height: calc(92vh - 130px);
  }

  .modal-foot {
    padding: 12px 16px;
  }

  /* Image Upload Area in Mobile */
  .upload-preview-area {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
  }

  .upload-preview-img {
    width: 100%;
    max-width: 280px;
    height: 180px;
  }

  .upload-preview-details {
    width: 100%;
    text-align: center;
  }

  .upload-preview-details div[style*="display: flex"] {
    justify-content: center;
  }

  #btnAutoGenerateImage,
  #btnGenerateGeminiAiContent {
    width: 100%;
    min-height: 42px;
    justify-content: center;
    margin-top: 4px;
  }

  /* Preset Chips */
  .upload-preset-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .preset-chip {
    font-size: 0.74rem;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  .admin-modal-card {
    max-height: 96vh;
  }

  .modal-body {
    padding: 12px;
    max-height: calc(96vh - 120px);
  }

  .form-label {
    font-size: 0.8rem;
  }

  .form-control {
    font-size: 0.86rem;
    padding: 9px 12px;
  }

  /* Address search buttons in smartphone */
  #formAddress + button,
  #btnSearchAddressPostcode,
  #btnFetchBuildingLedger,
  #btnGenerateGeminiAiContent {
    flex: 1;
    min-height: 40px;
    font-size: 0.8rem !important;
  }
}

/* Gemini AI Button Effects */
#btnGenerateGeminiAiContent {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, filter 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}
#btnGenerateGeminiAiContent:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(155, 81, 224, 0.5) !important;
  filter: brightness(1.1);
}
#btnGenerateGeminiAiContent:active:not(:disabled) {
  transform: translateY(0);
}

/* AI Keyword Assistant & Quick Chips */
.ai-keyword-card {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ai-keyword-card:focus-within {
  border-color: rgba(168, 85, 247, 0.55) !important;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.16);
}
.ai-keyword-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #DDD6FE;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.74rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ai-keyword-chip:hover {
  background: rgba(168, 85, 247, 0.22);
  border-color: #C084FC;
  color: #FFF;
  transform: translateY(-1px);
}
.ai-keyword-chip.active {
  background: linear-gradient(135deg, #7E22CE, #9333EA) !important;
  border-color: #C084FC !important;
  color: #FFF !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(147, 51, 234, 0.45);
}
@media (max-width: 480px) {
  .ai-keyword-chip {
    padding: 5px 9px;
    font-size: 0.72rem;
    min-height: 28px;
  }
}

/* =========================================================================
   Multi-Image 4-Slot Gallery Grid & TinyPNG Management
   ========================================================================= */
.gallery-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.gallery-slot {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px dashed rgba(255, 255, 255, 0.24);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.gallery-slot.filled {
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: #0B132B;
}

.gallery-slot.is-primary {
  border: 2px solid #FF8D03;
  box-shadow: 0 0 14px rgba(255, 141, 3, 0.4);
}

.gallery-slot.empty {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
}

.gallery-slot.empty:hover {
  border-color: #60A5FA;
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.gallery-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-slot-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.gallery-slot-badge.primary {
  background: #FF8D03;
  color: #FFFFFF;
}

.gallery-slot-badge.sub {
  background: rgba(15, 23, 42, 0.85);
  color: #D1D5DB;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gallery-slot-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  padding: 8px 6px 6px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 3;
}

.gallery-slot:hover .gallery-slot-actions {
  opacity: 1;
}

.gallery-slot-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gallery-slot-btn:hover {
  background: #2563EB;
  border-color: #3B82F6;
}

.gallery-slot-btn.delete {
  background: rgba(239, 68, 68, 0.8);
  border-color: #EF4444;
}

.gallery-slot-btn.delete:hover {
  background: #DC2626;
}

.gallery-slot-empty-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #9CA3AF;
  font-size: 0.74rem;
  font-weight: 600;
  pointer-events: none;
  text-align: center;
  padding: 6px;
}

.gallery-slot-empty-label span.icon {
  font-size: 1.3rem;
  color: #60A5FA;
}

@media (max-width: 640px) {
  .gallery-slots-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .gallery-slot-actions {
    opacity: 1;
  }

  .login-card {
    padding: 26px 18px;
    border-radius: var(--radius-lg);
  }

  .login-title {
    font-size: 1.3rem;
  }

  .admin-modal-card {
    max-width: 95vw !important;
    padding: 16px;
    margin: 10px auto;
  }

  .form-row {
    flex-direction: column;
    gap: 10px;
  }
}



/* 실시간 방문 분석 */
.ga-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ga-title { margin: 0; font-size: 1.2rem; }
.ga-sub { margin: 4px 0 0; color: #9CA3AF; font-size: 0.85rem; }
.ga-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ga-actions a { text-decoration: none; display: inline-flex; align-items: center; }
.ga-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 16px; }
.ga-box { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; padding: 14px 16px; }
.ga-box h3 { margin: 0 0 10px; font-size: 0.92rem; color: #E5E7EB; }
.ga-list { list-style: none; margin: 0; padding: 0; }
.ga-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.08); font-size: 0.86rem; color: #D1D5DB; }
.ga-list li:last-child { border-bottom: 0; }
.ga-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ga-list li strong { color: #FFFFFF; }
.ga-list .ga-empty { color: #6B7280; justify-content: center; }
.ga-note { margin-top: 12px; color: #6B7280; font-size: 0.78rem; }
