:root {
    --primary-blue: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Pretendard', sans-serif; }
body { background-color: var(--bg-color); color: var(--text-main); padding: 15px; }
.container { max-width: 550px; margin: 0 auto; }
.card { background: var(--card-bg); border: 1px solid var(--border-color); padding: 20px; border-radius: 12px; margin-bottom: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.hidden { display: none !important; }

/* 타이틀 및 입력창 */
.title { text-align: center; margin-bottom: 20px; font-size: 20px; color: var(--text-main); }
.sub-title { font-size: 14px; margin-bottom: 10px; color: var(--primary-blue); font-weight: bold; }
.input-group { margin-bottom: 12px; }
.input-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text-muted); }
input, select, textarea { 
    width: 100%; padding: 10px; border: 1px solid var(--border-color); border-radius: 6px; 
    font-size: 15px; background: #fff;
}

/* 🌟 체크박스 그룹 전용 스타일 */
.checkbox-group { display: flex; gap: 15px; margin-top: 10px; flex-wrap: wrap; }
.checkbox-group label { 
    display: flex; align-items: center; gap: 5px; 
    font-size: 13px; font-weight: 500; color: var(--text-main); 
    cursor: pointer; margin-bottom: 0; 
}
.checkbox-group input[type="checkbox"] { width: 16px; height: 16px; margin: 0; cursor: pointer; }

/* 버튼 */
.btn { width: 100%; padding: 12px; background: var(--primary-blue); color: white; border: none; border-radius: 66px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.btn:hover { background: var(--primary-hover); }
.btn.outline { background: transparent; color: var(--primary-blue); border: 1px solid var(--primary-blue); }
.btn.small { width: auto; padding: 6px 12px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.btn.success { background: #10b981 !important; color: white !important; border: none !important; }

.btn.editing {
    background-color: var(--danger); color: white; border: none;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* 명단 스타일 */
.region-card { background: white; border: 1px solid var(--border-color); border-radius: 10px; margin-bottom: 15px; overflow: hidden; }
.region-header { background: #f1f5f9; padding: 10px 15px; font-weight: 700; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.club-section { padding: 12px 15px; border-bottom: 1px dashed #edf2f7; }
.club-title { color: var(--primary-blue); font-weight: 700; font-size: 14px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.member-list { display: flex; flex-wrap: wrap; gap: 8px; }
.member-item { 
    display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: #f8fafc; 
    border: 1px solid var(--border-color); border-radius: 20px; font-size: 14px; cursor: pointer; user-select: none;
}
.member-item.checked { border-color: var(--primary-blue); background: #eff6ff; color: var(--primary-blue); }

.delete-x { color: var(--danger); font-weight: bold; margin-left: 5px; cursor: pointer; border-left: 1px solid #cbd5e1; padding-left: 5px; font-size: 1.1em; }

.editable-title { cursor: pointer; transition: all 0.2s; padding: 2px 5px; border-radius: 4px; }
.editable-title:hover { background-color: #eff6ff; text-decoration: underline; }

.inline-input {
    padding: 4px 10px; border: 2px solid var(--primary-blue); border-radius: 15px;
    font-size: 13px; outline: none; background: #fff; width: auto;
    box-shadow: 0 0 5px rgba(37, 99, 235, 0.2);
}
.inline-input::placeholder { color: #94a3b8; }
.inline-form-group { display: flex; gap: 5px; align-items: center; margin-top: 5px; }

.grid-inputs { display: grid; grid-template-columns: 1fr 1fr 1fr 60px; gap: 8px; }
.admin-box { background: #fff7ed; border-color: #fdba74; margin-top: 15px; }

.btn-large-add {
    width: 100%; padding: 12px;
    background-color: transparent; color: var(--primary-blue); font-size: 16px; font-weight: bold;
    border: 1px dashed var(--primary-blue); border-radius: 8px; cursor: pointer; transition: 0.2s;
}
.btn-large-add:hover { background-color: #eff6ff; }

.btn-group { display: flex; gap: 10px; margin-bottom: 10px; }
textarea { height: 250px; font-family: monospace; font-size: 13px; background: #fafafa; }
.flex-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

/* 로딩 스피너 */
#loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.8); z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    backdrop-filter: blur(2px);
}
.spinner {
    width: 40px; height: 40px;
    border: 4px solid #e2e8f0; border-top: 4px solid var(--primary-blue);
    border-radius: 50%; animation: spin 1s linear infinite;
}
.loading-text { margin-top: 15px; font-size: 14px; font-weight: bold; color: var(--primary-blue); }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }