<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>@yield('title', '문서') - {{ config('app.name') }}</title>
    @vite(['resources/css/app.css'])
    <style>
        @media print {
            body { margin: 0; padding: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
            .no-print { display: none !important; }
            .document-page { box-shadow: none !important; margin: 0 !important; padding: 10mm 15mm !important; }
        }
        @page { size: A4; margin: 10mm 15mm; }
    </style>
    @stack('styles')
</head>
<body class="bg-gray-100 min-h-screen">
    {{-- 액션 버튼 (인쇄 시 숨김) --}}
    <div class="no-print fixed top-4 right-4 z-50 flex gap-2">
        <button onclick="window.print()"
                class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg shadow-lg flex items-center gap-2 transition">
            <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"/>
            </svg>
            <span class="text-sm font-medium">인쇄 / PDF</span>
        </button>
        <button onclick="window.close(); if(!window.closed) history.back();"
                class="bg-white hover:bg-gray-100 text-gray-700 px-4 py-2 rounded-lg shadow-lg border flex items-center gap-2 transition">
            <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/>
            </svg>
            <span class="text-sm font-medium">돌아가기</span>
        </button>
    </div>

    @yield('content')

    @stack('scripts')
</body>
</html>
