/* ═══════════════════════════════════════
   넥서스아이 공통 CSS
   ═══════════════════════════════════════ */

/* ── 변수 ── */
:root {
  --primary:      #4f7df9;
  --primary-dark: #3a67e8;
  --bg:           #f4f6fb;
  --surface:      #ffffff;
  --surface2:     #eef1f8;
  --border:       #dde2ef;
  --text:         #1a2035;
  --muted:        #6b7a99;
  --green:        #16a34a;
  --red:          #dc2626;
  --yellow:       #d97706;
  --sidebar-w:    240px;
  --header-h:     56px;
}

/* ── 리셋 ── */
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  font-family:'Malgun Gothic','Apple SD Gothic Neo',sans-serif;
  color:var(--text); line-height:1.6;
}
a { text-decoration:none; color:inherit; }

/* ══════════════════════════════════════
   공개 페이지 — 상단 내비게이션
   ══════════════════════════════════════ */
.site-header {
  position:sticky; top:0; z-index:100;
  background:rgba(255,255,255,0.95); backdrop-filter:blur(12px);
  border-bottom:1px solid var(--border);
}
.header-inner {
  max-width:1160px; margin:0 auto; padding:0 24px;
  height:64px; display:flex; align-items:center; justify-content:space-between;
}
.logo { font-size:20px; font-weight:800; color:#1a2035; letter-spacing:-0.5px; }
.logo span { color:var(--primary); }
.site-nav { display:flex; align-items:center; gap:32px; }
.site-nav a { font-size:14px; color:var(--muted); transition:color .2s; }
.site-nav a:hover { color:var(--text); }
.header-actions { display:flex; align-items:center; gap:20px; }
.header-actions a { font-size:14px; color:var(--muted); transition:color .2s; }
.header-actions a:hover { color:var(--text); }
.btn-primary {
  padding:8px 20px; background:var(--primary); border-radius:6px;
  font-size:13px; color:#fff !important; font-weight:600; transition:background .2s;
}
.btn-primary:hover { background:var(--primary-dark); }

@media(max-width:900px) { .site-nav { display:none; } }

/* ══════════════════════════════════════
   공개 페이지 — 푸터
   ══════════════════════════════════════ */
.site-footer {
  background:#f8faff; border-top:1px solid var(--border); padding:48px 24px 28px;
}
.footer-inner { max-width:1160px; margin:0 auto; }
.footer-top { display:flex; gap:48px; flex-wrap:wrap; margin-bottom:40px; }
.footer-brand { flex:1.5; min-width:200px; }
.footer-brand .logo { font-size:18px; display:block; margin-bottom:10px; }
.footer-brand p { font-size:13px; color:var(--muted); line-height:1.7; }
.footer-col { flex:1; min-width:140px; }
.footer-col h5 {
  font-size:12px; font-weight:700; color:var(--muted);
  text-transform:uppercase; letter-spacing:1px; margin-bottom:14px;
}
.footer-col a { display:block; font-size:13px; color:#8a9ab8; margin-bottom:8px; transition:color .2s; }
.footer-col a:hover { color:var(--text); }
.footer-bottom {
  border-top:1px solid var(--border); padding-top:20px;
  display:flex; justify-content:space-between; align-items:center;
  flex-wrap:wrap; gap:12px;
}
.footer-bottom p { font-size:12px; color:var(--muted); }

/* ══════════════════════════════════════
   대시보드 — 사이드바
   ══════════════════════════════════════ */
.sidebar {
  position:fixed; top:0; left:0; bottom:0;
  width:var(--sidebar-w); background:var(--surface);
  border-right:1px solid var(--border);
  display:flex; flex-direction:column;
  z-index:200; transition:transform .25s ease;
}
.sidebar-logo {
  height:var(--header-h); display:flex; align-items:center;
  padding:0 20px; border-bottom:1px solid var(--border);
  font-size:16px; font-weight:800; letter-spacing:-0.3px; flex-shrink:0;
}
.sidebar-logo span { color:var(--primary); }
.sidebar-logo .badge {
  margin-left:8px; font-size:10px; background:var(--primary);
  color:#fff; padding:2px 7px; border-radius:10px; font-weight:700;
}
.sidebar-nav { flex:1; overflow-y:auto; padding:12px 0; }
.nav-group { margin-bottom:4px; }
.nav-label {
  font-size:10px; font-weight:700; color:var(--muted);
  text-transform:uppercase; letter-spacing:1.2px;
  padding:10px 20px 4px;
}
.nav-item {
  display:flex; align-items:center; gap:10px;
  padding:9px 20px; font-size:13px; color:var(--muted);
  transition:background .15s, color .15s; cursor:pointer; position:relative;
}
.nav-item:hover { background:var(--bg); color:var(--text); }
.nav-item.active {
  background:rgba(79,125,249,0.1); color:var(--primary); font-weight:700;
}
.nav-item.active::before {
  content:''; position:absolute; left:0; top:4px; bottom:4px;
  width:3px; background:var(--primary); border-radius:0 3px 3px 0;
}
.nav-icon { font-size:16px; width:20px; text-align:center; }
.nav-badge {
  margin-left:auto; background:#ef4444; color:#fff;
  font-size:10px; font-weight:700; padding:1px 6px; border-radius:10px;
}

/* ── 사이드바 하단 (관리자용) ── */
.sidebar-footer {
  padding:14px 20px; border-top:1px solid var(--border);
  font-size:12px; color:var(--muted); flex-shrink:0;
}
.sidebar-footer .admin-name { font-weight:700; color:var(--text); font-size:13px; }
.sidebar-footer .logout { display:block; margin-top:8px; font-size:12px; color:var(--muted); transition:color .15s; }
.sidebar-footer .logout:hover { color:var(--red); }

/* ── 사이드바 하단 (마이페이지용) ── */
.sidebar-user {
  padding:16px 18px; border-top:1px solid var(--border); flex-shrink:0;
}
.user-email { font-size:12px; color:var(--muted); margin-bottom:2px; }
.user-name { font-size:14px; font-weight:700; }
.user-actions { margin-top:10px; display:flex; gap:8px; }
.user-actions a { font-size:12px; color:var(--muted); transition:color .15s; }
.user-actions a:hover { color:var(--text); }
.user-actions .sep { color:var(--border); }

/* ── 오버레이 (모바일) ── */
.sidebar-overlay {
  display:none; position:fixed; inset:0;
  background:rgba(0,0,0,0.4); z-index:199;
}
.sidebar-overlay.show { display:block; }

/* ══════════════════════════════════════
   대시보드 — 상단 헤더 + 컨텐츠 영역
   ══════════════════════════════════════ */
.main-header {
  position:fixed; top:0; left:var(--sidebar-w); right:0;
  height:var(--header-h); background:var(--surface);
  border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  padding:0 24px; z-index:100;
}
.hamburger {
  display:none; background:none; border:none; cursor:pointer;
  padding:6px; border-radius:6px; color:var(--text);
}
.hamburger:hover { background:var(--bg); }
.hamburger svg { display:block; }
.page-title { font-size:15px; font-weight:700; }
.header-right { display:flex; align-items:center; gap:12px; }
.header-icon {
  width:34px; height:34px; border-radius:8px; display:flex;
  align-items:center; justify-content:center; font-size:16px;
  background:var(--bg); cursor:pointer; transition:background .15s; position:relative;
}
.header-icon:hover { background:var(--border); }
.header-icon .dot {
  position:absolute; top:6px; right:6px;
  width:8px; height:8px; background:#ef4444; border-radius:50%;
  border:2px solid var(--surface);
}
.header-avatar {
  width:32px; height:32px; border-radius:8px;
  background:var(--primary); color:#fff; font-size:13px; font-weight:700;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.header-btn {
  padding:7px 14px; border:1px solid var(--border); border-radius:7px;
  font-size:13px; font-weight:700; color:var(--primary); background:#fff;
  cursor:pointer; transition:all .15s;
}
.header-btn:hover { background:var(--primary); color:#fff; border-color:var(--primary); }

.main-wrap {
  margin-left:var(--sidebar-w);
  padding-top:var(--header-h);
  min-height:100vh;
}
.main-content { padding:28px; }
.page-head { margin-bottom:24px; }
.page-head h1 { font-size:20px; font-weight:800; margin-bottom:4px; }
.page-head p { font-size:13px; color:var(--muted); }

/* ══════════════════════════════════════
   공통 컴포넌트
   ══════════════════════════════════════ */

/* 카드 */
.card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:12px; padding:22px; margin-bottom:16px;
}
.card-head {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:18px;
}
.card-head h3 { font-size:14px; font-weight:700; }
.card-head a { font-size:12px; color:var(--primary); }

/* 테이블 */
.table { width:100%; border-collapse:collapse; }
.table th {
  font-size:11px; font-weight:700; color:var(--muted);
  text-align:left; padding:6px 0 10px; border-bottom:1px solid var(--border);
  text-transform:uppercase; letter-spacing:0.5px;
}
.table td { font-size:13px; padding:10px 0; border-bottom:1px solid var(--bg); }
.table tr:last-child td { border-bottom:none; }

/* 상태 뱃지 */
.status-badge {
  display:inline-block; font-size:11px; font-weight:700;
  padding:2px 8px; border-radius:10px;
}
.status-badge.active   { background:#dcfce7; color:#15803d; }
.status-badge.pending  { background:#fef9c3; color:#854d0e; }
.status-badge.expired  { background:#fee2e2; color:#991b1b; }
.status-badge.suspended{ background:#e5e7eb; color:#374151; }
.status-badge.canceled { background:#fee2e2; color:#991b1b; }

/* ══════════════════════════════════════
   반응형
   ══════════════════════════════════════ */
@media(max-width:768px) {
  .sidebar { transform:translateX(-100%); }
  .sidebar.open { transform:translateX(0); }
  .main-header { left:0; }
  .main-wrap { margin-left:0; }
  .hamburger { display:flex; align-items:center; }
  .main-content { padding:20px 16px; }
}
