@extends('layouts.app')

@section('title', 'Google Workspace 운영 정책')

@push('styles')
<style>
    .gc-section-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.05); border: 1px solid #e5e7eb; overflow: hidden; }
    .gc-section-header { padding: 12px 20px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
    .gc-section-header h2 { font-size: 15px; font-weight: 600; color: #1f2937; }
    .gc-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 9999px; font-size: 12px; font-weight: 600; }
    .gc-badge-blue { background: #dbeafe; color: #1e40af; }
    .gc-badge-green { background: #dcfce7; color: #166534; }
    .gc-badge-amber { background: #fef3c7; color: #92400e; }
    .gc-badge-red { background: #fee2e2; color: #991b1b; }
    .gc-info-box { padding: 12px 16px; border-radius: 8px; font-size: 13px; }
</style>
@endpush

@section('content')
<div class="space-y-6">

    {{-- 페이지 헤더 --}}
    <div>
        <h1 class="text-2xl font-bold text-gray-900">Google Workspace 운영 정책</h1>
        <p class="mt-1 text-sm text-gray-500">@codebridge-x.com 단체 계정 관리 가이드</p>
    </div>

    {{-- 요약 카드 --}}
    <div class="flex gap-4" style="flex-wrap: wrap;">
        <div class="bg-white rounded-lg shadow-sm border border-gray-200 p-5" style="flex: 1 1 220px; max-width: 320px;">
            <div class="flex items-center gap-2 text-sm text-gray-500">
                <svg class="w-4 h-4 text-blue-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9"/></svg>
                도메인
            </div>
            <div class="text-lg font-bold text-gray-900 mt-1">@codebridge-x.com</div>
            <div class="text-sm text-gray-500 mt-0.5">Google Workspace 단체 계정</div>
        </div>
        <div class="bg-white rounded-lg shadow-sm border border-gray-200 p-5" style="flex: 1 1 220px; max-width: 320px;">
            <div class="flex items-center gap-2 text-sm text-gray-500">
                <svg class="w-4 h-4 text-emerald-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/></svg>
                보안
            </div>
            <div class="text-lg font-bold text-gray-900 mt-1">2단계 인증 필수</div>
            <div class="text-sm text-emerald-600 mt-0.5">Super Admin 의무화 (2024~)</div>
        </div>
        <div class="bg-white rounded-lg shadow-sm border border-gray-200 p-5" style="flex: 1 1 220px; max-width: 320px;">
            <div class="flex items-center gap-2 text-sm text-gray-500">
                <svg class="w-4 h-4 text-amber-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"/></svg>
                관리 콘솔
            </div>
            <div class="text-lg font-bold text-gray-900 mt-1">admin.google.com</div>
            <div class="text-sm text-gray-500 mt-0.5">사용자/보안/감사 통합 관리</div>
        </div>
    </div>

    {{-- ─── 섹션 1: 계정 관리 기본 ─── --}}
    <div class="gc-section-card">
        <div class="gc-section-header">
            <h2>1. 계정 관리 기본</h2>
        </div>
        <div class="p-5 space-y-4">
            <div class="gc-info-box bg-blue-50 border border-blue-200">
                <div class="font-semibold text-blue-800 mb-1">관리 콘솔 접속</div>
                <div class="text-blue-700">
                    <a href="https://admin.google.com" target="_blank" class="underline font-medium">admin.google.com</a>
                    — Super Admin 계정으로 로그인하여 모든 설정을 관리합니다.
                </div>
            </div>

            <div>
                <div class="text-sm font-medium text-gray-700 mb-2">사용자 관리 절차</div>
                <table class="w-full text-sm">
                    <thead>
                        <tr class="border-b border-gray-200">
                            <th class="text-left py-2.5 px-3 text-gray-600 font-medium" style="width: 20%;">작업</th>
                            <th class="text-left py-2.5 px-3 text-gray-600 font-medium" style="width: 30%;">경로</th>
                            <th class="text-left py-2.5 px-3 text-gray-600 font-medium">설명</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="border-b border-gray-100">
                            <td class="py-2.5 px-3 font-medium text-gray-800">사용자 추가</td>
                            <td class="py-2.5 px-3 text-gray-600">Directory > Users > Add new user</td>
                            <td class="py-2.5 px-3 text-gray-600">이름, 이메일(@codebridge-x.com), 임시 비밀번호 설정</td>
                        </tr>
                        <tr class="border-b border-gray-100">
                            <td class="py-2.5 px-3 font-medium text-gray-800">사용자 삭제</td>
                            <td class="py-2.5 px-3 text-gray-600">Directory > Users > 사용자 선택 > Delete</td>
                            <td class="py-2.5 px-3 text-gray-600">삭제 전 데이터 이전(Transfer) 권장, 20일간 복구 가능</td>
                        </tr>
                        <tr class="border-b border-gray-100">
                            <td class="py-2.5 px-3 font-medium text-gray-800">사용자 정지</td>
                            <td class="py-2.5 px-3 text-gray-600">Directory > Users > Suspend user</td>
                            <td class="py-2.5 px-3 text-gray-600">계정 일시 정지 (데이터 보존, 로그인 차단)</td>
                        </tr>
                        <tr>
                            <td class="py-2.5 px-3 font-medium text-gray-800">비밀번호 초기화</td>
                            <td class="py-2.5 px-3 text-gray-600">Directory > Users > Reset password</td>
                            <td class="py-2.5 px-3 text-gray-600">임시 비밀번호 발급, 다음 로그인 시 변경 강제</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <div>
                <div class="text-sm font-medium text-gray-700 mb-2">관리자 권한 역할</div>
                <table class="w-full text-sm">
                    <thead>
                        <tr class="border-b border-gray-200">
                            <th class="text-left py-2.5 px-3 text-gray-600 font-medium" style="width: 25%;">역할</th>
                            <th class="text-left py-2.5 px-3 text-gray-600 font-medium" style="width: 30%;">권한 범위</th>
                            <th class="text-left py-2.5 px-3 text-gray-600 font-medium">권장 대상</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="border-b border-gray-100">
                            <td class="py-2.5 px-3">
                                <span class="gc-badge gc-badge-red">Super Admin</span>
                            </td>
                            <td class="py-2.5 px-3 text-gray-600">모든 설정, 결제, 사용자 관리</td>
                            <td class="py-2.5 px-3 text-gray-600">대표 / IT 관리자 (최소 1~2명)</td>
                        </tr>
                        <tr class="border-b border-gray-100">
                            <td class="py-2.5 px-3">
                                <span class="gc-badge gc-badge-amber">Groups Admin</span>
                            </td>
                            <td class="py-2.5 px-3 text-gray-600">그룹 생성/수정/삭제, 구성원 관리</td>
                            <td class="py-2.5 px-3 text-gray-600">팀장급</td>
                        </tr>
                        <tr class="border-b border-gray-100">
                            <td class="py-2.5 px-3">
                                <span class="gc-badge gc-badge-blue">User Mgmt Admin</span>
                            </td>
                            <td class="py-2.5 px-3 text-gray-600">사용자 추가/수정/비밀번호 초기화</td>
                            <td class="py-2.5 px-3 text-gray-600">인사/총무 담당자</td>
                        </tr>
                        <tr>
                            <td class="py-2.5 px-3">
                                <span class="gc-badge gc-badge-green">Help Desk Admin</span>
                            </td>
                            <td class="py-2.5 px-3 text-gray-600">비밀번호 초기화, 사용자 조회</td>
                            <td class="py-2.5 px-3 text-gray-600">일반 지원 담당자</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    {{-- ─── 섹션 2: 보안 정책 (2단계 인증) ─── --}}
    <div class="gc-section-card">
        <div class="gc-section-header">
            <h2>2. 보안 정책 (2단계 인증)</h2>
        </div>
        <div class="p-5 space-y-4">
            <div class="gc-info-box bg-red-50 border border-red-200">
                <div class="font-semibold text-red-800">Super Admin 2SV 의무화 (2024년~)</div>
                <div class="text-red-700 mt-1">Google은 2024년부터 모든 Super Admin에 대해 2단계 인증(2SV)을 의무화했습니다. 미설정 시 관리 콘솔 접근이 차단될 수 있습니다.</div>
            </div>

            <div>
                <div class="text-sm font-medium text-gray-700 mb-2">2단계 인증 방법</div>
                <table class="w-full text-sm">
                    <thead>
                        <tr class="border-b border-gray-200">
                            <th class="text-left py-2.5 px-3 text-gray-600 font-medium" style="width: 22%;">인증 방법</th>
                            <th class="text-center py-2.5 px-3 text-gray-600 font-medium" style="width: 12%;">보안 수준</th>
                            <th class="text-left py-2.5 px-3 text-gray-600 font-medium" style="width: 30%;">설명</th>
                            <th class="text-left py-2.5 px-3 text-gray-600 font-medium">권장 대상</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="border-b border-gray-100">
                            <td class="py-2.5 px-3 font-medium text-gray-800">보안 키 (FIDO2)</td>
                            <td class="py-2.5 px-3 text-center"><span class="gc-badge gc-badge-green">최고</span></td>
                            <td class="py-2.5 px-3 text-gray-600">YubiKey 등 물리적 보안 키 사용</td>
                            <td class="py-2.5 px-3 text-gray-600">Super Admin 필수 권장</td>
                        </tr>
                        <tr class="border-b border-gray-100">
                            <td class="py-2.5 px-3 font-medium text-gray-800">Google Prompt</td>
                            <td class="py-2.5 px-3 text-center"><span class="gc-badge gc-badge-blue">높음</span></td>
                            <td class="py-2.5 px-3 text-gray-600">스마트폰에 푸시 알림으로 승인</td>
                            <td class="py-2.5 px-3 text-gray-600">일반 관리자</td>
                        </tr>
                        <tr class="border-b border-gray-100">
                            <td class="py-2.5 px-3 font-medium text-gray-800">Authenticator 앱</td>
                            <td class="py-2.5 px-3 text-center"><span class="gc-badge gc-badge-blue">높음</span></td>
                            <td class="py-2.5 px-3 text-gray-600">TOTP 기반 6자리 코드 (30초 갱신)</td>
                            <td class="py-2.5 px-3 text-gray-600">전 직원</td>
                        </tr>
                        <tr>
                            <td class="py-2.5 px-3 font-medium text-gray-800">SMS / 전화</td>
                            <td class="py-2.5 px-3 text-center"><span class="gc-badge gc-badge-amber">보통</span></td>
                            <td class="py-2.5 px-3 text-gray-600">문자 메시지 또는 전화 음성으로 코드 수신</td>
                            <td class="py-2.5 px-3 text-gray-600">최후 수단 (SIM 스왑 위험)</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <div class="gc-info-box bg-gray-50 border border-gray-200">
                <div class="font-semibold text-gray-700 mb-1">관리 콘솔 설정 경로</div>
                <div class="text-gray-600">
                    <code class="bg-gray-200 px-1.5 py-0.5 rounded text-xs">Security > Authentication > 2-step verification</code>
                    <span class="ml-2">— 조직 전체 또는 OU(조직 단위)별 강제 적용 가능</span>
                </div>
            </div>
        </div>
    </div>

    {{-- ─── 섹션 3: 감사 로그 ─── --}}
    <div class="gc-section-card">
        <div class="gc-section-header">
            <h2>3. 감사 로그</h2>
        </div>
        <div class="p-5">
            <table class="w-full text-sm">
                <thead>
                    <tr class="border-b border-gray-200">
                        <th class="text-left py-2.5 px-3 text-gray-600 font-medium" style="width: 20%;">로그 유형</th>
                        <th class="text-left py-2.5 px-3 text-gray-600 font-medium" style="width: 35%;">기록 내용</th>
                        <th class="text-left py-2.5 px-3 text-gray-600 font-medium" style="width: 20%;">보존 기간</th>
                        <th class="text-left py-2.5 px-3 text-gray-600 font-medium">접근 경로</th>
                    </tr>
                </thead>
                <tbody>
                    <tr class="border-b border-gray-100">
                        <td class="py-2.5 px-3 font-medium text-gray-800">Admin</td>
                        <td class="py-2.5 px-3 text-gray-600">관리 콘솔 설정 변경, 사용자/그룹 관리</td>
                        <td class="py-2.5 px-3 text-gray-600">6개월</td>
                        <td class="py-2.5 px-3 text-gray-600">Reporting > Audit > Admin</td>
                    </tr>
                    <tr class="border-b border-gray-100">
                        <td class="py-2.5 px-3 font-medium text-gray-800">Login</td>
                        <td class="py-2.5 px-3 text-gray-600">로그인 성공/실패, 의심스러운 시도, 2SV 사용</td>
                        <td class="py-2.5 px-3 text-gray-600">6개월</td>
                        <td class="py-2.5 px-3 text-gray-600">Reporting > Audit > Login</td>
                    </tr>
                    <tr class="border-b border-gray-100">
                        <td class="py-2.5 px-3 font-medium text-gray-800">Drive</td>
                        <td class="py-2.5 px-3 text-gray-600">파일 생성/수정/삭제/공유/다운로드</td>
                        <td class="py-2.5 px-3 text-gray-600">6개월</td>
                        <td class="py-2.5 px-3 text-gray-600">Reporting > Audit > Drive</td>
                    </tr>
                    <tr class="border-b border-gray-100">
                        <td class="py-2.5 px-3 font-medium text-gray-800">Gmail</td>
                        <td class="py-2.5 px-3 text-gray-600">메일 발신/수신 메타데이터 (내용 제외)</td>
                        <td class="py-2.5 px-3 text-gray-600">6개월</td>
                        <td class="py-2.5 px-3 text-gray-600">Reporting > Audit > Gmail</td>
                    </tr>
                    <tr class="border-b border-gray-100">
                        <td class="py-2.5 px-3 font-medium text-gray-800">Meet</td>
                        <td class="py-2.5 px-3 text-gray-600">화상회의 참여/종료, 녹화 시작/종료</td>
                        <td class="py-2.5 px-3 text-gray-600">6개월</td>
                        <td class="py-2.5 px-3 text-gray-600">Reporting > Audit > Meet</td>
                    </tr>
                    <tr>
                        <td class="py-2.5 px-3 font-medium text-gray-800">Groups</td>
                        <td class="py-2.5 px-3 text-gray-600">그룹 생성/삭제, 멤버 추가/제거, 설정 변경</td>
                        <td class="py-2.5 px-3 text-gray-600">6개월</td>
                        <td class="py-2.5 px-3 text-gray-600">Reporting > Audit > Groups</td>
                    </tr>
                </tbody>
            </table>
            <div class="mt-4 gc-info-box bg-blue-50 border border-blue-200 text-blue-800">
                <strong>참고:</strong> 감사 로그는 기본 6개월 보존됩니다. Google Vault(Plus 이상)를 사용하면 보존 기간을 확장하고 법적 보존(Legal Hold)을 설정할 수 있습니다.
            </div>
        </div>
    </div>

    {{-- ─── 섹션 4: 데이터 보존 정책 ─── --}}
    <div class="gc-section-card">
        <div class="gc-section-header">
            <h2>4. 데이터 보존 정책</h2>
        </div>
        <div class="p-5 space-y-4">
            <div>
                <div class="text-sm font-medium text-gray-700 mb-2">Google Vault 지원 범위</div>
                <table class="w-full text-sm">
                    <thead>
                        <tr class="border-b border-gray-200">
                            <th class="text-left py-2.5 px-3 text-gray-600 font-medium" style="width: 25%;">서비스</th>
                            <th class="text-center py-2.5 px-3 text-gray-600 font-medium" style="width: 15%;">보존 지원</th>
                            <th class="text-center py-2.5 px-3 text-gray-600 font-medium" style="width: 15%;">eDiscovery</th>
                            <th class="text-left py-2.5 px-3 text-gray-600 font-medium">비고</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="border-b border-gray-100">
                            <td class="py-2.5 px-3 font-medium text-gray-800">Gmail</td>
                            <td class="py-2.5 px-3 text-center text-emerald-600 font-semibold">O</td>
                            <td class="py-2.5 px-3 text-center text-emerald-600 font-semibold">O</td>
                            <td class="py-2.5 px-3 text-gray-600">메일 본문 + 첨부파일</td>
                        </tr>
                        <tr class="border-b border-gray-100">
                            <td class="py-2.5 px-3 font-medium text-gray-800">Drive</td>
                            <td class="py-2.5 px-3 text-center text-emerald-600 font-semibold">O</td>
                            <td class="py-2.5 px-3 text-center text-emerald-600 font-semibold">O</td>
                            <td class="py-2.5 px-3 text-gray-600">공유 드라이브 포함</td>
                        </tr>
                        <tr class="border-b border-gray-100">
                            <td class="py-2.5 px-3 font-medium text-gray-800">Chat</td>
                            <td class="py-2.5 px-3 text-center text-emerald-600 font-semibold">O</td>
                            <td class="py-2.5 px-3 text-center text-emerald-600 font-semibold">O</td>
                            <td class="py-2.5 px-3 text-gray-600">DM + Space 메시지</td>
                        </tr>
                        <tr class="border-b border-gray-100">
                            <td class="py-2.5 px-3 font-medium text-gray-800">Meet 녹화</td>
                            <td class="py-2.5 px-3 text-center text-emerald-600 font-semibold">O</td>
                            <td class="py-2.5 px-3 text-center text-gray-400">-</td>
                            <td class="py-2.5 px-3 text-gray-600">Drive에 저장된 녹화 파일</td>
                        </tr>
                        <tr>
                            <td class="py-2.5 px-3 font-medium text-gray-800">Groups</td>
                            <td class="py-2.5 px-3 text-center text-emerald-600 font-semibold">O</td>
                            <td class="py-2.5 px-3 text-center text-emerald-600 font-semibold">O</td>
                            <td class="py-2.5 px-3 text-gray-600">그룹 게시물/메시지</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <div class="flex gap-4" style="flex-wrap: wrap;">
                <div class="p-4 bg-amber-50 border border-amber-200 rounded-lg" style="flex: 1 1 280px;">
                    <div class="text-sm font-semibold text-amber-800">보존 기간 설정</div>
                    <div class="text-sm text-amber-700 mt-1">1일 ~ 36,500일 (약 100년) 설정 가능. 조직 단위(OU)별 다른 보존 규칙 적용 가능.</div>
                </div>
                <div class="p-4 bg-gray-50 border border-gray-200 rounded-lg" style="flex: 1 1 280px;">
                    <div class="text-sm font-semibold text-gray-700">휴지통 복구 기간</div>
                    <div class="text-sm text-gray-600 mt-1">사용자 삭제 후 <strong>30일</strong> 이내 휴지통에서 복구 가능. 이후 영구 삭제. Vault 보존 규칙이 있으면 영구 삭제 방지.</div>
                </div>
            </div>

            <div class="gc-info-box bg-emerald-50 border border-emerald-200 text-emerald-800">
                <strong>플랜 요구사항:</strong> Google Vault는 <span class="gc-badge gc-badge-blue">Business Plus</span> 이상 또는 별도 Vault 라이선스에 포함됩니다. Starter/Standard에서는 추가 구매 필요.
            </div>
        </div>
    </div>

    <p class="text-xs text-gray-400 text-center">※ Google Workspace 관리자 도움말 기준. 정책 변경 시 admin.google.com에서 최신 정보를 확인하세요.</p>

</div>
@endsection
