/* ===== 기본 리셋 & 변수 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #0f3d2e;
    --primary-hover: #155239;
    --gold: #c9a961;
    --destructive: #ef4444;
    --destructive-hover: #dc2626;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-full: 9999px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans KR', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { text-decoration: none; color: var(--primary); }
a:hover { text-decoration: underline; }

/* ===== 버튼 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-outline { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--bg); }
.btn-danger { background: var(--destructive); color: white; }
.btn-danger:hover:not(:disabled) { background: var(--destructive-hover); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-full { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }

/* ===== 입력 폼 ===== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--white);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.15);
}
.form-input::placeholder { color: var(--text-light); }

/* ===== 카드 ===== */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header { padding: 20px 24px 0; }
.card-body { padding: 20px 24px; }
.card-footer { padding: 0 24px 20px; }

/* ===== 로그인 / 회원가입 ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0f3d2e 0%, #1c5a44 60%, #2a6b52 100%);   /* 브랜드 딥 그린 */
}
.auth-box {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    padding: 56px 64px 48px;
    width: 100%;
    max-width: 680px;            /* 기존 340px 의 2배 */
}
.auth-box .logo { text-align: center; margin-bottom: 32px; }
.auth-logo-img { height: 72px; width: auto; max-width: 100%; object-fit: contain; }
.auth-box .logo h1 { font-size: 28px; font-weight: 700; margin-top: 18px; }
.auth-box .logo p { color: var(--text-muted); font-size: 16px; margin-top: 6px; }
.auth-box .auth-footer { text-align: center; margin-top: 20px; font-size: 15px; color: var(--text-muted); }
.auth-box .form-group { margin-bottom: 20px; }
.auth-box .form-group label { font-size: 15px; }
.auth-box .form-input { padding: 15px 18px; font-size: 16px; border-radius: 10px; }
.auth-box .btn-full { padding: 15px; font-size: 17px; border-radius: 10px; }
.auth-box .auth-remember { font-size: 15px; margin: 4px 0 22px; }
.auth-box .auth-remember input { width: 18px; height: 18px; }
.auth-box .auth-lang-inbox { top: 18px; right: 18px; }
.auth-box .auth-lang-inbox .lang-toggle { transform: none; }
@media (max-width: 768px) {
    .auth-box { padding: 36px 24px 28px; border-radius: 16px; }
    .auth-box .logo { margin-top: 26px; }   /* 언어 전환 버튼과 로고가 겹치지 않도록 */
    .auth-logo-img { height: 56px; }
    .auth-box .logo h1 { font-size: 22px; }
}
.auth-box .form-group label { font-size: 12px; margin-bottom: 4px; }
.auth-box .form-input { padding: 8px 10px; font-size: 13px; }
.auth-box .btn { padding: 8px 16px; font-size: 13px; }
.auth-error {
    background: #fef2f2; color: #dc2626; padding: 12px; border-radius: var(--radius-sm);
    font-size: 14px; margin-bottom: 16px; display: none;
}
.auth-success {
    background: #f0fdf4; color: #16a34a; padding: 12px; border-radius: var(--radius-sm);
    font-size: 14px; margin-bottom: 16px; display: none;
}

/* ===== 승인 대기 페이지 ===== */
.pending-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    
    background: linear-gradient(135deg, #0f3d2e 0%, #1c5a44 60%, #2a6b52 100%);   /* 브랜드 딥 그린 */
}
.pending-box {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}
.pending-icon {
    width: 64px; height: 64px; border-radius: 50%; background: #fef3c7;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px; font-size: 32px;
}
.pending-box h1 { font-size: 24px; margin-bottom: 8px; }
.pending-box p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.pending-box .btn { margin-bottom: 8px; }

/* ===== 헤더 ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 16px;
}
.header-logo { display: flex; align-items: center; text-decoration: none; color: var(--text); flex-shrink: 0; }
.header-logo-img { height: 66px; width: auto; object-fit: contain; }
.header-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}
.header-search .search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-light); font-size: 16px;
}
.header-search input {
    width: 100%; padding: 8px 14px 8px 38px; border: 1px solid var(--border);
    border-radius: var(--radius-full); font-size: 14px; background: var(--bg);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.header-search input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,61,46,0.15); background: var(--white);
}
.header-user { position: relative; }
.header-user-btn {
    display: flex; align-items: center; gap: 8px; padding: 6px 12px;
    border: none; background: transparent; cursor: pointer; border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.header-user-btn:hover { background: var(--bg); }
.header-avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--primary);
    color: white; display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600;
}
.header-user-name { font-size: 14px; font-weight: 500; }

/* ===== 드롭다운 메뉴 ===== */
.dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 4px;
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md); min-width: 200px; z-index: 200;
    display: none; overflow: hidden;
}
.dropdown.open { display: block; }
.dropdown-header { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dropdown-header .name { font-size: 14px; font-weight: 600; }
.dropdown-header .email { font-size: 12px; color: var(--text-muted); }
.dropdown-item {
    display: flex; align-items: center; gap: 8px; padding: 10px 16px; width: 100%;
    border: none; background: none; font-size: 14px; cursor: pointer;
    color: var(--text); transition: background 0.1s; text-align: left;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--destructive); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== 메인 콘텐츠 ===== */
.main { max-width: 1280px; margin: 0 auto; padding: 20px; }
.section { margin-bottom: 24px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.section-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.category-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; position: relative; }
.cat-edit-btn {
    background: none; border: none; font-size: 12px; cursor: pointer;
    padding: 2px 4px; line-height: 1; border-radius: 50%;
    opacity: 0; transition: opacity 0.15s; color: var(--text-muted);
    margin-left: 4px;
}
.category-title:hover .cat-edit-btn { opacity: 1; }
.cat-edit-btn:hover { color: var(--primary); }

/* ===== 사이트 카드 그리드 ===== */
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 8px;
}
.site-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 30px 10px 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
    color: var(--text);
}
.site-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.site-card.dragging { opacity: 0.5; box-shadow: var(--shadow-lg); }
.site-card img { width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0; }
.site-card .site-info { display: flex; flex-direction: column; min-width: 0; }
.site-card .site-name { font-size: 13px; font-weight: 500; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.site-card .site-desc { font-size: 11px; color: var(--text-muted); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-card .bookmark-btn {
    position: absolute; top: 50%; right: 8px; transform: translateY(-50%); background: none; border: none;
    font-size: 16px; cursor: pointer; padding: 2px; line-height: 1;
    opacity: 0.3; transition: opacity 0.15s;
}
.site-card:hover .bookmark-btn { opacity: 0.7; }
.site-card .bookmark-btn.active { opacity: 1; color: #eab308; }
.site-card .remove-btn {
    position: absolute; top: 50%; right: 8px; transform: translateY(-50%); background: rgba(255,255,255,0.9); border: none;
    font-size: 14px; cursor: pointer; padding: 2px 4px; line-height: 1; border-radius: 50%;
    opacity: 0; transition: opacity 0.15s; color: var(--text-muted);
}
.site-card:hover .remove-btn { opacity: 1; }
.site-card .remove-btn:hover { color: var(--destructive); }
.site-card .drag-handle {
    position: absolute; top: 50%; left: 2px; transform: translateY(-50%); font-size: 12px; cursor: grab;
    opacity: 0; transition: opacity 0.15s; color: var(--text-light);
}
.site-card:hover .drag-handle { opacity: 1; }

/* 빈 상태 */
.empty-state {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 24px 16px; text-align: center; color: var(--text-muted); font-size: 13px;
}

/* ===== 관리자 레이아웃 ===== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 250px; background: var(--white); border-right: 1px solid var(--border);
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; padding: 20px 0;
}
.admin-sidebar .back-link {
    display: flex; align-items: center; gap: 8px; padding: 10px 20px;
    font-size: 13px; color: var(--text-muted); text-decoration: none;
}
.admin-sidebar .back-link:hover { color: var(--text); text-decoration: none; }
.admin-sidebar h2 { padding: 16px 20px 12px; font-size: 18px; font-weight: 700; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.admin-nav a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border-radius: var(--radius-sm); font-size: 14px; color: var(--text-muted);
    text-decoration: none; transition: all 0.15s;
}
.admin-nav a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.admin-nav a.active { background: var(--primary); color: white; }
.admin-main { flex: 1; margin-left: 250px; padding: 32px; }

/* ===== 탭 ===== */
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: var(--radius-sm); margin-bottom: 20px; width: fit-content; }
.tab-btn {
    padding: 8px 16px; border: none; background: transparent; border-radius: 6px;
    font-size: 14px; font-weight: 500; cursor: pointer; color: var(--text-muted);
    transition: all 0.15s;
}
.tab-btn.active { background: var(--white); color: var(--text); box-shadow: var(--shadow-sm); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== 테이블 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th { text-align: left; font-size: 13px; font-weight: 500; color: var(--text-muted); padding: 10px 12px; border-bottom: 1px solid var(--border); }
table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
table tr:last-child td { border-bottom: none; }

/* ===== 관리자 스탯 카드 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow-sm); cursor: pointer; transition: box-shadow 0.15s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; }
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 8px; }

/* 뱃지 */
.badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 2px 8px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600;
}
.badge-red { background: #fef2f2; color: #dc2626; }
.badge-blue { background: #eff6ff; color: #2563eb; }
.badge-green { background: #f0fdf4; color: #16a34a; }
.badge-yellow { background: #fffbeb; color: #d97706; }

/* 카테고리 리스트 아이템 */
/* 학원 그룹 접기/열기 */
.cat-group-header {
    display: flex; align-items: center; gap: 8px; padding: 10px 4px;
    cursor: pointer; user-select: none; font-size: 15px; color: var(--text-muted);
    border-bottom: 1px solid var(--border); margin-bottom: 8px; margin-top: 16px;
}
.cat-group-header:first-child { margin-top: 0; }
.cat-group-header:hover { color: var(--text); }
.cat-group-header .toggle-arrow { font-size: 12px; transition: transform 0.2s; display: inline-block; width: 16px; }
.cat-group-header.collapsed .toggle-arrow { transform: rotate(-90deg); }
.cat-group-body { overflow: hidden; transition: max-height 0.3s ease; }
.cat-group-body.collapsed { max-height: 0 !important; overflow: hidden; }

.cat-item {
    display: flex; flex-direction: column;
    padding: 0; background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: 8px; transition: box-shadow 0.15s;
    overflow: hidden;
}
.cat-item:hover { box-shadow: var(--shadow-sm); }
.cat-item-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; width: 100%; }
.cat-item .cat-left { display: flex; align-items: center; gap: 12px; cursor: pointer; flex: 1; }
.cat-item .cat-icon { font-size: 20px; }
.cat-item .cat-name { font-weight: 500; }
.cat-item .cat-count { font-size: 12px; color: var(--text-muted); }
.cat-item .cat-toggle { font-size: 10px; color: var(--text-light); transition: transform 0.2s; display: inline-block; }
.cat-item .cat-toggle.open { transform: rotate(90deg); }
.cat-item .cat-actions { display: flex; gap: 4px; flex-shrink: 0; }
.cat-item .drag-handle { cursor: grab; color: var(--text-light); font-size: 18px; margin-right: 8px; }

/* 카테고리 내 사이트 목록 */
.cat-sites-list { display: none; padding: 0 16px 12px 56px; border-top: 1px solid var(--border); }
.cat-sites-list.open { display: block; }
.cat-site-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; color: var(--text-muted); }
.cat-site-row .site-icon { font-size: 16px; flex-shrink: 0; }
.cat-site-row .site-url { font-size: 11px; opacity: 0.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }

/* 셀렉트 */
.form-select {
    padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 14px; background: var(--white); color: var(--text); cursor: pointer;
}
.form-select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,0.15);
}

/* ===== 모달 ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 500; display: flex; align-items: center; justify-content: center;
    padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
    transform: scale(0.95); transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 0;
}
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); padding: 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 16px 24px 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 0 24px 20px; }

/* ===== 토스트 ===== */
#toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px;
    box-shadow: var(--shadow-md); animation: toastIn 0.3s; min-width: 260px;
}
.toast-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.toast-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.toast button { background: none; border: none; cursor: pointer; font-size: 18px; color: inherit; opacity: 0.7; }
.toast-hide { animation: toastOut 0.3s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(50px); } }

/* ===== 스켈레톤 ===== */
.skeleton { background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== 스피너 ===== */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; }
.spinner-dark { border-color: rgba(0,0,0,0.1); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 반응형 ===== */
@media (max-width: 768px) {
    .header-logo-img { height: 18px; }
    .header-user-name { display: none; }
    .site-grid { grid-template-columns: 1fr; gap: 6px; }
    .admin-sidebar { display: none; }
    .admin-main { margin-left: 0; padding: 16px; }
    .admin-mobile-nav {
        display: flex; gap: 8px; padding: 12px; overflow-x: auto;
        border-bottom: 1px solid var(--border); background: var(--white);
        position: sticky; top: 0; z-index: 40;
    }
    .admin-mobile-nav a {
        white-space: nowrap; padding: 6px 14px; border-radius: var(--radius-full);
        font-size: 13px; color: var(--text-muted); text-decoration: none; background: var(--bg);
    }
    .admin-mobile-nav a.active { background: var(--primary); color: white; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .auth-box { padding: 20px 16px; }
    .pending-box { padding: 28px 20px; }
}

@media (min-width: 769px) {
    .admin-mobile-nav { display: none; }
    .site-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

@media (min-width: 1024px) {
    .site-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ===== 유틸 ===== */
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }

/* ===== 이모지 피커 ===== */
.emoji-preview {
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    font-size: 28px; border: 2px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; transition: border-color 0.15s;
}
.emoji-preview:hover { border-color: var(--primary); }
.emoji-picker {
    display: none; max-height: 220px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px; margin-top: 8px; background: var(--white);
}
.emoji-picker.open { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; }
.emoji-picker button {
    background: none; border: none; font-size: 22px; padding: 6px;
    cursor: pointer; border-radius: 6px; transition: background 0.1s;
    text-align: center; line-height: 1;
}
.emoji-picker button:hover { background: var(--bg); }

/* ===== 커스텀 배경 ===== */
body.has-bg {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}
body.has-bg::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
body.has-bg .header {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
}
body.has-bg .main {
    position: relative;
    z-index: 1;
}
body.has-bg .site-card {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(4px);
}
body.has-bg .section-title,
body.has-bg .category-title {
    text-shadow: 0 1px 3px rgba(255,255,255,0.6);
}
body.has-bg .empty-state {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(4px);
}

/* 밝기 슬라이더 */
#bg-brightness {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #334155, #fbbf24);
    outline: none;
}
#bg-brightness::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

/* 즐겨찾기 수정 버튼 */
.site-card .edit-btn {
    position: absolute; top: 50%; right: 26px; transform: translateY(-50%);
    background: rgba(255,255,255,0.9); border: none; font-size: 12px;
    cursor: pointer; padding: 2px 4px; line-height: 1; border-radius: 50%;
    opacity: 0; transition: opacity 0.15s; color: var(--text-muted);
}
.site-card:hover .edit-btn { opacity: 1; }
.site-card .edit-btn:hover { color: var(--primary); }

/* ===== 언어 토글 ===== */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 4px 8px;
    font-size: 13px;
    user-select: none;
}
.lang-toggle button {
    background: none;
    border: none;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
    line-height: 1;
}
.lang-toggle button.active {
    background: var(--primary);
    color: white;
}
.lang-toggle button:hover:not(.active) {
    color: var(--text);
    background: var(--white);
}
.lang-toggle .lang-divider {
    color: var(--border);
    font-size: 12px;
    line-height: 1;
}

/* 인증 페이지 언어 토글 (우측 상단 고정) */
.auth-lang-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

/* 관리자 사이드바 언어 토글 */
.admin-sidebar-lang {
    padding: 12px 20px;
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
}

/* 관리자 모바일 네비 언어 토글 */
.admin-mobile-lang {
    margin-left: auto;
    flex-shrink: 0;
}



/* 자동 로그인 체크박스 */
.auth-remember { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; font-size: 13px; color: var(--text-muted); cursor: pointer; user-select: none; }
.auth-remember input { width: 16px; height: 16px; accent-color: #4f6ef7; cursor: pointer; }


/* 로그인 화면: 언어 전환을 카드 안 우측 상단에 배치 */
.auth-box { position: relative; }
.auth-lang-inbox { position: absolute; top: 12px; right: 12px; }
.auth-lang-inbox .lang-toggle { transform: scale(0.9); transform-origin: top right; }

/* 승인 대기 화면 로고 (가로형 BI) */
.pending-box .auth-logo-img { height: 60px; }

/* 딥 그린 배경 위 카드 그림자와 링크 색 */
.auth-page .auth-box, .pending-page .pending-box { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28); }

/* 공용 사이트 카드: 삭제 버튼 (편집 버튼 왼쪽, hover 시 표시, 관리자/OWNER만 렌더링됨) */
.site-card .delete-btn {
    position: absolute; top: 50%; right: 46px; transform: translateY(-50%);
    background: rgba(255,255,255,0.9); border: none; font-size: 12px;
    cursor: pointer; padding: 2px 4px; line-height: 1; border-radius: 50%;
    opacity: 0; transition: opacity 0.15s; color: var(--text-muted);
}
.site-card:hover .delete-btn { opacity: 1; }
.site-card .delete-btn:hover { color: var(--destructive); }
/* 모달 안 삭제 버튼: 왼쪽 끝 */
.modal-footer .modal-delete-btn { margin-right: auto; }
.btn-danger-outline { background: transparent; border: 1px solid var(--destructive); color: var(--destructive); }
.btn-danger-outline:hover { background: var(--destructive); color: #fff; }

/* ===== 대시보드 테마 A: 그린 에디토리얼 ===== */
body.theme-a {
    --bg: #f6f5f0;
    --border: #e4e0d5;
    --text: #1b2a23;
    --text-muted: #7a8580;
    --text-light: #a3aca7;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
    background: var(--bg);
}
/* 헤더: 딥 그린 바 */
body.theme-a .header { background: #0f3d2e; border-bottom: 1px solid #0f3d2e; backdrop-filter: none; }
body.theme-a .header-inner { padding-top: 12px; padding-bottom: 12px; }
body.theme-a .header-logo-img { height: 40px; }
body.theme-a .header-search .search-icon { color: rgba(255,255,255,0.75); }
body.theme-a .header-search input {
    background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.18); color: #fff;
}
body.theme-a .header-search input::placeholder { color: rgba(255,255,255,0.7); }
body.theme-a .header-search input:focus { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.45); box-shadow: 0 0 0 3px rgba(255,255,255,0.12); }
body.theme-a .header-user-btn { color: #fff; }
body.theme-a .header-user-btn:hover { background: rgba(255,255,255,0.10); }
body.theme-a .header-avatar { background: var(--gold); color: #0f3d2e; }
body.theme-a .header-user-name { color: #fff; }
/* 섹션/카테고리 제목: 명조 + 금색 포인트 */
body.theme-a .section-title {
    font-family: 'Noto Serif KR', 'Noto Sans KR', serif; font-size: 20px; font-weight: 700; color: #0f3d2e; gap: 10px;
}
body.theme-a .section-title::before { content: ''; display: inline-block; width: 22px; height: 2px; background: var(--gold); }
body.theme-a .category-title {
    font-family: 'Noto Serif KR', 'Noto Sans KR', serif; font-size: 16px; font-weight: 700; color: #0f3d2e; margin-bottom: 10px;
}
body.theme-a .category-title::after { content: ''; flex: 1; height: 1px; background: #dcd6c8; margin-left: 8px; }
body.theme-a .category-title .cat-edit-btn { order: 99; }
/* 카드 */
body.theme-a .site-card { border-radius: 12px; border-color: #e4e0d5; box-shadow: 0 1px 2px rgba(20,40,30,0.05); padding: 12px 30px 12px 14px; gap: 12px; }
body.theme-a .site-card:hover { box-shadow: 0 6px 16px rgba(20,40,30,0.10); border-color: #d6d0c2; }
body.theme-a .site-card img { width: 32px; height: 32px; border-radius: 9px; }
body.theme-a .site-card .site-name { font-size: 13.5px; font-weight: 600; }
body.theme-a .site-card .site-desc { color: var(--text-muted); }
body.theme-a .site-card .bookmark-btn.active { color: var(--gold); }
body.theme-a .site-grid { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
body.theme-a .mb-16 { margin-bottom: 22px; }
/* 보조 버튼: 그린 아웃라인 */
body.theme-a .btn-outline, body.theme-a .btn-secondary { border-color: #0f3d2e; color: #0f3d2e; background: transparent; }
body.theme-a .btn-outline:hover, body.theme-a .btn-secondary:hover { background: #0f3d2e; color: #fff; }
