/* ============================================================
   AutoConsent Pro v2.0 — 메인 스타일시트
   디자인: 다크 사이드바 + 클린 화이트 본문
   ============================================================ */

/* ── CSS 변수 ─────────────────────────────────────────────── */
:root {
  /* 색상 팔레트 */
  --ink:       #0F172A;
  --ink-2:     #1E293B;
  --ink-3:     #334155;
  --muted:     #64748B;
  --subtle:    #94A3B8;
  --border:    #E2E8F0;
  --surface:   #F8FAFC;
  --white:     #FFFFFF;

  /* 액센트 */
  --accent:    #6366F1;
  --accent-d:  #4F46E5;
  --accent-l:  #EEF2FF;
  --teal:      #06B6D4;
  --violet:    #8B5CF6;
  --emerald:   #10B981;
  --amber:     #F59E0B;
  --red:       #EF4444;

  /* 사이드바 */
  --sb-bg:     #0F172A;
  --sb-item:   rgba(255,255,255,0.06);
  --sb-active: rgba(99,102,241,0.2);
  --sb-text:   #94A3B8;
  --sb-active-text: #A5B4FC;
  --sb-section:#334155;

  /* 레이아웃 */
  --sidebar-w: 240px;
  --topbar-h:  56px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-sm: 6px;
  --shadow:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);

  /* 타이포 */
  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'Fira Code', 'Cascadia Code', monospace;
}

/* ── 리셋 & 기본 ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ── 앱 레이아웃 ───────────────────────────────────────────── */
.app {
  display: flex;
  min-height: 100vh;
}

/* ── 사이드바 ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-3) transparent;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

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

.logo-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.sidebar-close {
  color: var(--sb-text);
  font-size: 16px;
  padding: 4px;
  display: none;
}

/* 회사 배지 */
.company-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 12px 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06);
}

.cb-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.cb-name {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cb-plan {
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}

/* 네비 섹션 타이틀 */
.nav-section {
  padding: 14px 16px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sb-section);
}

/* 네비 아이템 */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--sb-text);
  font-size: 13px;
  font-weight: 500;
  border-radius: 0;
  transition: background 0.12s, color 0.12s;
  position: relative;
  cursor: pointer;
  text-decoration: none;
  margin: 1px 0;
}

.nav-item:hover {
  background: var(--sb-item);
  color: #cbd5e1;
}

.nav-item.active {
  background: var(--sb-active);
  color: var(--sb-active-text);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-item i { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; }

.nav-chip {
  margin-left: auto;
  background: rgba(99,102,241,0.25);
  color: #a5b4fc;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.nav-locked {
  opacity: 0.4;
  cursor: not-allowed !important;
}

.nav-lock-icon {
  margin-left: auto !important;
  font-size: 11px !important;
  color: var(--sb-section) !important;
}

/* 사이드바 하단 */
.sidebar-foot {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: var(--sb-text);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
}

.logout-btn:hover {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
}

/* ── 메인 영역 ─────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* 오버레이 (모바일) */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}

/* 탑바 */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.hamburger {
  font-size: 18px;
  color: var(--muted);
  display: none;
  padding: 6px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

/* 페이지 본문 */
.page-body {
  flex: 1;
  padding: 28px 28px 40px;
  max-width: 1280px;
}

/* 페이지 헤더 */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.ph-left { flex: 1; min-width: 0; }

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.page-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

.ph-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── 버튼 ───────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background 0.12s, transform 0.1s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover { background: var(--accent-d); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--white);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: background 0.12s;
  cursor: pointer;
}

.btn-secondary:hover { background: var(--surface); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #FEF2F2;
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid #FECACA;
  transition: background 0.12s;
  cursor: pointer;
}

.btn-danger:hover { background: #FEE2E2; }

.btn-sm { padding: 6px 12px !important; font-size: 12px !important; }
.btn-lg { padding: 12px 24px !important; font-size: 15px !important; }

/* ── 카드 ───────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.card-action {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
}

.card-action:hover { text-decoration: underline; }

/* ── 스탯 카드 ──────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.stat-card.accent { border-left: 3px solid var(--accent); }
.stat-card.teal   { border-left: 3px solid var(--teal); }
.stat-card.violet { border-left: 3px solid var(--violet); }
.stat-card.emerald{ border-left: 3px solid var(--emerald); }

.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-change {
  font-size: 11px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-change.up   { color: var(--emerald); }
.stat-change.down { color: var(--red); }
.stat-change.flat { color: var(--muted); }

/* ── 폼 요소 ────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

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

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.12s, box-shadow 0.12s;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.form-control:disabled {
  background: var(--surface);
  color: var(--subtle);
  cursor: not-allowed;
}

.form-control::placeholder { color: var(--subtle); }

.form-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.form-error {
  font-size: 11px;
  color: var(--red);
  margin-top: 4px;
}

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

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* ── 테이블 ─────────────────────────────────────────────────── */
.table-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  flex: 1;
  max-width: 280px;
}

.search-box i { color: var(--subtle); font-size: 13px; }
.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: var(--ink);
  width: 100%;
}
.search-box input::placeholder { color: var(--subtle); }

table { width: 100%; border-collapse: collapse; }

thead { background: var(--surface); }

th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  font-size: 13px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFBFF; }

/* ── 상태 배지 ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: #F0FDF4; color: #15803D; }
.badge-warning { background: #FFFBEB; color: #B45309; }
.badge-danger  { background: #FEF2F2; color: #B91C1C; }
.badge-info    { background: var(--accent-l); color: var(--accent-d); }
.badge-muted   { background: var(--surface); color: var(--muted); }

.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* ── 알림 배너 ──────────────────────────────────────────────── */
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  animation: slideDown 0.25s ease;
}

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

.flash-success { background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }
.flash-error   { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.flash-info    { background: var(--accent-l); color: var(--accent-d); border: 1px solid #C7D2FE; }
.flash-warning { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }

.alert-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 20px;
}

.alert-bar.warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.alert-bar.danger  { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

/* ── 페이지네이션 ───────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--white);
  transition: all 0.12s;
}

.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── 모달 ───────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn { from { opacity: 0; transform: scale(0.96) translateY(-10px); } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 16px; font-weight: 700; color: var(--ink); }

.modal-close {
  color: var(--muted);
  font-size: 18px;
  padding: 4px;
  transition: color 0.12s;
}

.modal-close:hover { color: var(--ink); }

.modal-body { padding: 20px; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── 로그인 페이지 ──────────────────────────────────────────── */
.login-page {
  display: grid;
  grid-template-columns: 420px 1fr;
  min-height: 100vh;
}

.login-panel {
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 48px 40px;
  position: relative;
  overflow: hidden;
}

.login-panel::after {
  content: '';
  position: absolute;
  bottom: -120px; right: -120px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.login-panel .logo { margin-bottom: 48px; }

.login-hero h1 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}

.login-hero p {
  font-size: 14px;
  color: var(--subtle);
  line-height: 1.75;
  margin-bottom: 32px;
}

.feature-list { display: flex; flex-direction: column; gap: 10px; }

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #CBD5E1;
}

.feature-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.login-panel-foot {
  font-size: 12px;
  color: var(--sb-section);
}

/* 로그인 폼 패널 */
.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--white);
}

.login-form-wrap {
  width: 100%;
  max-width: 380px;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}

.login-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}

/* 사용자 타입 배지 (로그인) */
.user-detect {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  width: fit-content;
}

.user-detect.show { display: flex; }
.user-detect.admin    { background: #FEF2F2; color: #991B1B; }
.user-detect.company  { background: var(--accent-l); color: var(--accent-d); }
.user-detect.employee { background: #F0FDF4; color: #166534; }
.user-detect.pending  { background: #FFFBEB; color: #B45309; }

.input-pass-wrap { position: relative; }
.pass-toggle {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--subtle);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

.remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 20px;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.check-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px; height: 14px;
}

.forgot-link {
  font-size: 12px;
  color: var(--accent);
}
.forgot-link:hover { text-decoration: underline; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--subtle);
  font-size: 12px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* 플랜 선택 (가입) */
.plan-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.plan-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.plan-card:hover { border-color: var(--accent); background: var(--accent-l); }
.plan-card.selected { border-color: var(--accent); background: var(--accent-l); }

.plan-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.plan-card-price {
  font-size: 11px;
  color: var(--muted);
}

/* ── 서명 캔버스 ────────────────────────────────────────────── */
.signature-wrap {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.signature-wrap canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
  touch-action: none;
}

.sig-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--subtle);
  pointer-events: none;
  transition: opacity 0.2s;
}

/* ── 템플릿 에디터 ──────────────────────────────────────────── */
.template-editor {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}

.template-sidebar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.template-sidebar-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
}

.template-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.template-item:last-child { border-bottom: none; }
.template-item:hover { background: var(--surface); }
.template-item.active { background: var(--accent-l); }

.template-item-icon {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
}

.template-item-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.template-item-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 홈페이지 빌더 ──────────────────────────────────────────── */
.builder-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

.builder-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.builder-preview {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 600px;
}

.preview-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot-red   { width: 10px; height: 10px; border-radius: 50%; background: #FC605B; }
.dot-yellow{ width: 10px; height: 10px; border-radius: 50%; background: #FDBC40; }
.dot-green { width: 10px; height: 10px; border-radius: 50%; background: #35CD4B; }

/* ── 반응형 ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .overlay.open { display: block; }
  .hamburger { display: block; }
  .main { margin-left: 0; }
  .login-page { grid-template-columns: 1fr; }
  .login-panel { display: none; }
  .template-editor { grid-template-columns: 1fr; }
  .builder-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .page-body { padding: 16px 16px 32px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .plan-cards { grid-template-columns: 1fr; }
}

/* ── 유틸리티 ───────────────────────────────────────────────── */
.text-muted { color: var(--muted); }
.text-sm    { font-size: 12px; }
.text-xs    { font-size: 11px; }
.text-accent{ color: var(--accent); }
.font-medium{ font-weight: 500; }
.font-bold  { font-weight: 700; }
.truncate   { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-flex     { display: flex; }
.align-center { align-items: center; }
.gap-8      { gap: 8px; }
.gap-12     { gap: 12px; }
.gap-16     { gap: 16px; }
.mt-8       { margin-top: 8px; }
.mt-16      { margin-top: 16px; }
.mt-24      { margin-top: 24px; }
.mb-16      { margin-bottom: 16px; }
.mb-24      { margin-bottom: 24px; }
.grid-2     { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3     { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-auto  { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* ── 애니메이션 ─────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin    { to { transform: rotate(360deg); } }
.animate-fade { animation: fadeIn 0.3s ease; }
.spin { animation: spin 1s linear infinite; }

/* ── 빈 상태 ────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
}

.empty-state i {
  font-size: 40px;
  color: var(--border);
  margin-bottom: 16px;
  display: block;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.empty-state p { font-size: 13px; }
