/* ==========================================================================
   KUCM Admin Console — Modern SaaS Design System (v10)
   Typography: Pretendard Variable + Inter
   Features: Glassmorphism, Dark/Light Theme, Smooth Micro-interactions
   ========================================================================== */

:root {
  /* Primary Brand Colors */
  --admin-primary: #2563eb;
  --admin-primary-hover: #1d4ed8;
  --admin-primary-soft: rgba(37, 99, 235, 0.1);
  --admin-accent: #4f46e5;
  --admin-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);

  /* Surface & Background Colors (Light Mode) */
  --admin-bg: #f1f5f9;
  --admin-bg-pattern: radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.04) 0px, transparent 50%),
                      radial-gradient(at 100% 0%, rgba(79, 70, 229, 0.04) 0px, transparent 50%);
  --admin-card-bg: #ffffff;
  --admin-card-hover-bg: #f8fafc;
  --admin-topbar-bg: rgba(255, 255, 255, 0.82);
  --admin-border: #e2e8f0;
  --admin-border-subtle: #f1f5f9;

  /* Text Colors */
  --admin-text: #0f172a;
  --admin-text-secondary: #475569;
  --admin-text-muted: #64748b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --accent-color: #f59e0b;

  /* Sidebar Colors (Always Sleek Deep Slate) */
  --admin-sidebar-width: 272px;
  --admin-sidebar-bg: linear-gradient(180deg, #090d16 0%, #0f172a 60%, #111827 100%);
  --admin-sidebar-border: rgba(255, 255, 255, 0.07);
  --admin-sidebar-color: #94a3b8;
  --admin-sidebar-active-text: #ffffff;

  /* Shadows & Radius */
  --admin-radius-sm: 8px;
  --admin-radius-md: 12px;
  --admin-radius-lg: 16px;
  --admin-radius-xl: 20px;
  --admin-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --admin-shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  --admin-shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.07), 0 4px 10px -4px rgba(15, 23, 42, 0.04);
  --admin-shadow-lg: 0 20px 35px -8px rgba(15, 23, 42, 0.12);
}

/* 다크 모드 변수 */
html[data-theme="dark"] {
  --admin-primary: #3b82f6;
  --admin-primary-hover: #60a5fa;
  --admin-primary-soft: rgba(59, 130, 246, 0.16);
  --admin-bg: #0b0f19;
  --admin-bg-pattern: radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
                      radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.07) 0px, transparent 50%);
  --admin-card-bg: #111827;
  --admin-card-hover-bg: #1e293b;
  --admin-topbar-bg: rgba(17, 24, 39, 0.82);
  --admin-border: #1e293b;
  --admin-border-subtle: #1e293b;
  --admin-text: #f8fafc;
  --admin-text-secondary: #cbd5e1;
  --admin-text-muted: #94a3b8;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --admin-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --admin-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --admin-shadow-md: 0 12px 28px rgba(0, 0, 0, 0.45);
}

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

body.admin-body {
  margin: 0;
  padding: 0;
  background-color: var(--admin-bg);
  background-image: var(--admin-bg-pattern);
  background-attachment: fixed;
  font-family: 'Pretendard Variable', Pretendard, 'Inter', -apple-system, BlinkMacSystemFont, 'Noto Sans KR', sans-serif;
  color: var(--admin-text);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   1. 사이드바 (Admin Sidebar)
   ========================================================================== */
.admin-sidebar {
  width: var(--admin-sidebar-width);
  background: var(--admin-sidebar-bg);
  color: var(--admin-sidebar-color);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 200;
  border-right: 1px solid var(--admin-sidebar-border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--admin-sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: #ffffff;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sidebar-title {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.sidebar-badge {
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.sidebar-sub {
  font-size: 11.5px;
  color: #64748b;
  display: block;
  margin-top: 2px;
  font-weight: 500;
}

.sidebar-mobile-close {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* 사이드바 빠른 검색창 */
.sidebar-search-box {
  padding: 12px 16px 6px;
  flex-shrink: 0;
}

.sidebar-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sidebar-search-icon {
  position: absolute;
  left: 12px;
  font-size: 12.5px;
  color: #64748b;
  pointer-events: none;
}

.sidebar-search-input {
  width: 100%;
  height: 36px;
  padding: 0 32px 0 34px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  color: #e2e8f0;
  font-size: 12.5px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.sidebar-search-input::placeholder {
  color: #64748b;
}

.sidebar-search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.sidebar-search-kbd {
  position: absolute;
  right: 9px;
  font-family: 'Inter', monospace;
  font-size: 10.5px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 1px 5px;
  pointer-events: none;
}

/* 사이드바 네비게이션 */
.sidebar-nav {
  padding: 10px 12px 16px;
  flex-grow: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.nav-section {
  margin-bottom: 10px;
}

.nav-group-caption {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #475569;
  padding: 6px 12px 6px;
  text-transform: uppercase;
}

.nav-label-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 9px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.nav-label-wrapper:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.01em;
  margin: 0;
  transition: color 0.2s;
}

.nav-section-icon {
  font-size: 12px;
  color: #64748b;
  width: 16px;
  text-align: center;
}

.nav-label-wrapper:hover .nav-label,
.collapsible.active .nav-label {
  color: #e2e8f0;
}

.collapsible.active .nav-section-icon {
  color: #60a5fa;
}

.toggle-icon {
  font-size: 11px;
  color: #64748b;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
}

.collapsible.active .toggle-icon {
  transform: rotate(180deg);
  color: #94a3b8;
}

.nav-submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 6px;
  margin-top: 2px;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  margin-left: 18px;
}

.collapsible.active .nav-submenu {
  display: flex;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--admin-sidebar-color);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: all 0.18s ease;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: #64748b;
  transition: color 0.18s ease, transform 0.18s ease;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

.nav-item:hover i {
  color: #93c5fd;
  transform: translateX(1px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.22) 0%, rgba(99, 102, 241, 0.08) 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.25);
}

.nav-item.active i {
  color: #60a5fa;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 4px;
  background: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
}

.nav-section:not(.collapsible) .nav-item.active::before {
  left: 0;
}

/* 우측 상단 개선/제안 도우미 버튼 */
.btn-topbar-suggestion {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.12) 100%);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #6366f1;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.08);
  transition: all 0.22s ease;
}

[data-theme="dark"] .btn-topbar-suggestion {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16) 0%, rgba(139, 92, 246, 0.2) 100%);
  border-color: rgba(167, 139, 250, 0.35);
  color: #c4b5fd;
}

.btn-topbar-suggestion i {
  font-size: 14px;
  color: #7c3aed;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .btn-topbar-suggestion i {
  color: #a78bfa;
}

.btn-topbar-suggestion:hover,
.btn-topbar-suggestion.active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-color: #7c3aed;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
  transform: translateY(-1px);
}

.btn-topbar-suggestion:hover i,
.btn-topbar-suggestion.active i {
  color: #ffffff !important;
  transform: rotate(15deg);
}

.suggestion-btn-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(124, 58, 237, 0.14);
  color: #7c3aed;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .suggestion-btn-badge {
  background: rgba(167, 139, 250, 0.2);
  color: #ddd6fe;
}

.btn-topbar-suggestion:hover .suggestion-btn-badge,
.btn-topbar-suggestion.active .suggestion-btn-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff !important;
}

/* 사이드바 푸터 */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--admin-sidebar-border);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.admin-info {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.admin-meta {
  min-width: 0;
}

.admin-name {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-role {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.role-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.sidebar-logout {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* 데스크톱 사이드바 접기(Collapsed) 모드 */
body.sidebar-collapsed .admin-sidebar {
  transform: translateX(-100%);
}

body.sidebar-collapsed .admin-wrapper {
  margin-left: 0;
  width: 100%;
}

/* ==========================================================================
   2. 상단바 (Glassmorphism Topbar) & 메인 래퍼
   ========================================================================== */
.admin-wrapper {
  margin-left: var(--admin-sidebar-width);
  width: calc(100% - var(--admin-sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-topbar {
  height: 66px;
  background-color: var(--admin-topbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  font-size: 15px;
  cursor: pointer;
  color: var(--admin-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: var(--admin-shadow-xs);
}

.sidebar-toggle:hover {
  color: var(--admin-primary);
  border-color: var(--admin-primary);
  background: var(--admin-primary-soft);
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
}

.bc-root {
  color: var(--admin-text-muted);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}

.bc-root:hover {
  color: var(--admin-primary);
}

.bc-sep {
  font-size: 10px;
  color: var(--admin-text-muted);
  opacity: 0.6;
}

.bc-current {
  font-weight: 700;
  color: var(--admin-text);
}

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

.topbar-clock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--admin-text-secondary);
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  padding: 7px 13px;
  border-radius: 9px;
  box-shadow: var(--admin-shadow-xs);
}

.topbar-clock i {
  color: var(--admin-primary);
}

/* 빠른 등록 드롭다운 */
.topbar-quick-dropdown {
  position: relative;
}

.btn-quick-create {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  background: var(--admin-gradient);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.btn-quick-create:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.quick-caret {
  font-size: 10px;
  opacity: 0.85;
}

.quick-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 260px;
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  box-shadow: var(--admin-shadow-lg);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 3px;
  z-index: 300;
  animation: fadeDownMenu 0.18s ease;
}

.quick-dropdown-menu.open {
  display: flex;
}

@keyframes fadeDownMenu {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.quick-dropdown-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--admin-text-muted);
  padding: 6px 10px 4px;
  letter-spacing: 0.03em;
}

.quick-dropdown-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--admin-text);
  transition: background 0.15s ease;
}

.quick-dropdown-item:hover {
  background: var(--admin-card-hover-bg);
}

.quick-dropdown-item .q-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.quick-dropdown-item strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--admin-text);
}

.quick-dropdown-item small {
  display: block;
  font-size: 11.5px;
  color: var(--admin-text-muted);
  margin-top: 1px;
}

/* 테마 토글 버튼 */
.btn-theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: var(--admin-shadow-xs);
  transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
  color: var(--admin-primary);
  border-color: var(--admin-primary);
  transform: translateY(-1px);
}

.btn-view-site {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text-secondary);
  background: var(--admin-card-bg);
  text-decoration: none;
  padding: 0 15px;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  box-shadow: var(--admin-shadow-xs);
  transition: all 0.2s ease;
}

.btn-view-site:hover {
  color: var(--admin-primary);
  border-color: var(--admin-primary);
  background: var(--admin-primary-soft);
}

.admin-main {
  padding: 32px;
  flex-grow: 1;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.admin-footer {
  padding: 18px 32px;
  border-top: 1px solid var(--admin-border);
  font-size: 12.5px;
  color: var(--admin-text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   3. 페이지 헤더, 카드, 통계 위젯
   ========================================================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.page-title h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--admin-text);
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title p {
  font-size: 14px;
  color: var(--admin-text-muted);
  margin: 0;
  line-height: 1.5;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background-color: var(--admin-card-bg);
  padding: 22px 24px;
  border-radius: var(--admin-radius-lg);
  box-shadow: var(--admin-shadow-sm);
  border: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--admin-shadow-md);
  border-color: rgba(37, 99, 235, 0.3);
}

.stat-info h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text-muted);
  margin: 0 0 8px 0;
}

.stat-info p {
  font-family: 'Inter', 'Pretendard Variable', sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--admin-text);
  margin: 0;
  line-height: 1.1;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--admin-primary-soft);
  color: var(--admin-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
}

/* 공통 카드 */
.admin-card,
.table-card {
  background-color: var(--admin-card-bg);
  padding: 28px;
  border-radius: var(--admin-radius-lg);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow-sm);
  transition: box-shadow 0.2s ease;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

/* 갤러리 / 주보 등 그리드 카드 */
.grid {
  display: grid;
}

.card {
  background: var(--admin-card-bg) !important;
  border: 1px solid var(--admin-border) !important;
  border-radius: var(--admin-radius-lg) !important;
  box-shadow: var(--admin-shadow-sm);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--admin-shadow-md);
}

/* ==========================================================================
   4. 모던 데이터 테이블 (.table-responsive & .admin-table)
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  background-color: var(--admin-card-bg);
  border-radius: var(--admin-radius-lg);
  box-shadow: var(--admin-shadow-sm);
  border: 1px solid var(--admin-border);
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.admin-table th {
  background-color: var(--admin-card-hover-bg);
  padding: 14px 20px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--admin-text-muted);
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 16px 20px;
  font-size: 14px;
  color: var(--admin-text);
  border-bottom: 1px solid var(--admin-border-subtle);
  vertical-align: middle;
  transition: background-color 0.15s ease;
}

.admin-table tbody tr:hover td {
  background-color: var(--admin-card-hover-bg);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table td strong {
  color: var(--admin-text);
  font-weight: 600;
}

/* ==========================================================================
   5. 버튼, 배지, 폼 컨트롤
   ========================================================================== */
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--admin-gradient);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.btn-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
  filter: brightness(1.05);
}

.btn,
.btn-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}

.btn-admin {
  width: 100%;
  padding: 11px 20px;
  background: var(--admin-gradient);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22);
}

.btn-admin:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.32);
}

.btn-admin-danger {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
  box-shadow: none !important;
}

.btn-admin-danger:hover {
  background: #fecaca !important;
  color: #b91c1c !important;
}

.btn-primary {
  background: var(--admin-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  background-color: var(--admin-card-bg);
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: all 0.18s ease;
}

.btn-cancel:hover {
  background-color: var(--admin-card-hover-bg);
  color: var(--admin-primary);
  border-color: var(--admin-primary);
}

/* 테이블 내 인라인 액션 버튼 보정 */
.admin-table .btn {
  border-radius: 8px !important;
  font-weight: 600 !important;
  transition: transform 0.15s ease, filter 0.15s ease !important;
}

.admin-table .btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.95);
}

/* 소그룹/샘터 및 테이블 인라인 액션 버튼 */
.btn-cg-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.2;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn-cg-posts {
  background: #eef2ff;
  color: #4f46e5;
  border-color: #c7d2fe;
}
.btn-cg-posts:hover {
  background: #e0e7ff;
  color: #3730a3;
}
.btn-cg-members {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}
.btn-cg-members:hover {
  background: #dcfce7;
  color: #15803d;
}
.btn-cg-edit {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
.btn-cg-edit:hover {
  background: #fef3c7;
  color: #92400e;
}
.btn-cg-delete {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
  padding: 6px 9px;
}
.btn-cg-delete:hover {
  background: #fee2e2;
  color: #b91c1c;
}

[data-theme="dark"] .btn-cg-posts {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.35);
}
[data-theme="dark"] .btn-cg-members {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
}
[data-theme="dark"] .btn-cg-edit {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
}
[data-theme="dark"] .btn-cg-delete {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

/* 배지 공통 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.badge-success {
  background-color: #dcfce7;
  color: #15803d;
}

.badge-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* 폼 요소 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--admin-text);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--admin-card-bg);
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.14);
}

input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--admin-primary);
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  border-top: 1px solid var(--admin-border);
  padding-top: 22px;
}

/* ==========================================================================
   6. 플래시 알림 배너 (Flash Messages)
   ========================================================================== */
.admin-flash-wrap {
  padding: 20px 32px 0;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.admin-flash {
  padding: 14px 18px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--admin-shadow-sm);
  animation: slideDownFlash 0.25s ease;
}

@keyframes slideDownFlash {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-flash-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flash-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.admin-flash-success {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.admin-flash-success .flash-icon {
  background-color: #10b981;
  color: #ffffff;
}

.admin-flash-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.admin-flash-error .flash-icon {
  background-color: #ef4444;
  color: #ffffff;
}

.flash-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: currentColor;
  opacity: 0.6;
  cursor: pointer;
}

.flash-close:hover {
  opacity: 1;
}

/* ==========================================================================
   7. 관리자 페이지네이션 (.admin-pagination)
   ========================================================================== */
.admin-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
}

.admin-page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background-color: var(--admin-card-bg);
  color: var(--admin-text-secondary);
  border: 1px solid var(--admin-border);
  box-shadow: var(--admin-shadow-xs);
  transition: all 0.18s ease;
}

.admin-page-btn:hover {
  border-color: var(--admin-primary);
  color: var(--admin-primary);
  transform: translateY(-1px);
}

.admin-page-btn.active {
  background: var(--admin-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28);
}

/* ==========================================================================
   8. 관리자 로그인 페이지 (Modern Aurora Glass Login)
   ========================================================================== */
.admin-login-wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: #070b14;
  background-image:
    radial-gradient(at 20% 20%, rgba(37, 99, 235, 0.28) 0px, transparent 50%),
    radial-gradient(at 80% 80%, rgba(99, 102, 241, 0.22) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(14, 165, 233, 0.1) 0px, transparent 60%);
  position: relative;
  overflow: hidden;
}

.login-flash-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(239, 68, 68, 0.95);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.35);
  z-index: 500;
}

.login-flash-toast button {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
}

.admin-login-card {
  width: 100%;
  max-width: 430px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  padding: 44px 40px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  position: relative;
  z-index: 2;
}

.admin-login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.admin-login-logo-badge {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.admin-login-logo-badge i,
.admin-login-logo > i {
  font-size: 26px;
  color: #ffffff;
  margin: 0;
}

.admin-login-logo h1 {
  font-family: 'Inter', 'Pretendard Variable', sans-serif;
  font-size: 23px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0;
}

/* ==========================================================================
   9. 다크 모드 세부 호환성 보정
   ========================================================================== */
html[data-theme="dark"] .admin-card h3,
html[data-theme="dark"] .admin-table td,
html[data-theme="dark"] .admin-table td div,
html[data-theme="dark"] .admin-table td strong {
  color: var(--admin-text);
}

html[data-theme="dark"] .sermon-filter-bar,
html[data-theme="dark"] .sg-stat-card,
html[data-theme="dark"] .board-card,
html[data-theme="dark"] .chatbot-card,
html[data-theme="dark"] .suggestion-item,
html[data-theme="dark"] .modal-content {
  background-color: var(--admin-card-bg) !important;
  border-color: var(--admin-border) !important;
  color: var(--admin-text) !important;
}

html[data-theme="dark"] .sermon-category-select,
html[data-theme="dark"] .sermon-search-input,
html[data-theme="dark"] .super-note-input,
html[data-theme="dark"] .chatbot-textarea {
  background-color: #0f172a !important;
  border-color: var(--admin-border) !important;
  color: var(--admin-text) !important;
}

html[data-theme="dark"] .sg-stat-info strong,
html[data-theme="dark"] .board-header h2 {
  color: var(--admin-text) !important;
}

html[data-theme="dark"] .suggestion-content-box,
html[data-theme="dark"] .super-admin-panel,
html[data-theme="dark"] .chatbot-stepper,
html[data-theme="dark"] .chatbot-input-area {
  background-color: #0f172a !important;
  border-color: var(--admin-border) !important;
  color: var(--admin-text-secondary) !important;
}

/* ==========================================================================
   10. Summernote WYSIWYG 에디터 스타일
   ========================================================================== */
.note-editor.note-frame {
  border: 1px solid var(--admin-border) !important;
  border-radius: 12px !important;
  box-shadow: var(--admin-shadow-xs);
  font-family: 'Pretendard Variable', 'Noto Sans KR', sans-serif !important;
  background-color: #ffffff;
  overflow: hidden;
}

.note-editor.note-frame .note-toolbar {
  background-color: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 8px 12px !important;
}

.note-editor.note-frame .note-statusbar {
  background-color: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
}

.note-editor.note-frame .note-editing-area .note-editable {
  padding: 18px 22px !important;
  font-size: 15px;
  line-height: 1.75;
  color: #1e293b;
  background-color: #ffffff;
}

.note-btn {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
  border-radius: 6px !important;
  padding: 5px 10px !important;
  font-size: 13px !important;
  transition: all 0.15s ease;
}

.note-btn:hover,
.note-btn.active {
  background-color: #eff6ff !important;
  color: #2563eb !important;
  border-color: #bfdbfe !important;
}

/* ==========================================================================
   11. 반응형 (Responsive Design)
   ========================================================================== */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.55);
  backdrop-filter: blur(3px);
  z-index: 150;
}

@media (max-width: 992px) {
  .topbar-clock {
    display: none;
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.active {
    transform: translateX(0);
  }
  .sidebar-backdrop.active {
    display: block;
  }
  .sidebar-mobile-close {
    display: inline-flex;
  }
  .admin-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .admin-topbar {
    padding: 0 16px;
  }
  .admin-main {
    padding: 20px 16px;
  }
  .btn-view-site span,
  .btn-quick-create span,
  .btn-topbar-suggestion .suggestion-btn-text,
  .btn-topbar-suggestion .suggestion-btn-badge {
    display: none;
  }
  .btn-topbar-suggestion {
    padding: 0 11px;
  }
}
