/** 관리자 설정 화면 잠금 해제 (세션, 30분) */
const KEY = 'gc_admin_unlock_until';
const TTL_MS = 30 * 60 * 1000;

export function isAdminUnlocked(): boolean {
  const until = Number(sessionStorage.getItem(KEY) ?? 0);
  return Number.isFinite(until) && until > Date.now();
}

export function setAdminUnlocked(): void {
  sessionStorage.setItem(KEY, String(Date.now() + TTL_MS));
}

export function clearAdminUnlock(): void {
  sessionStorage.removeItem(KEY);
}
