<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}" dir="{{ in_array(app()->getLocale(), ['ar']) ? 'rtl' : 'ltr' }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{ $asset->code }} — {{ $asset->name }}</title>
    <style>
        * { box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Arial, sans-serif; }
        body { margin: 0; background: #eef0f3; padding: 24px; }
        .label {
            width: 360px; margin: 0 auto; background: #fff; border: 2px solid #1f2733;
            border-radius: 10px; padding: 20px; text-align: center;
        }
        .label .brand { font-size: 12px; letter-spacing: 2px; color: #b08d35; text-transform: uppercase; }
        .label .name { font-size: 18px; font-weight: 700; color: #1f2733; margin: 6px 0 2px; }
        .label .cat { font-size: 12px; color: #6b7280; margin-bottom: 12px; }
        .label .qr img { width: 200px; height: 200px; }
        .label .qr .fallback {
            width: 200px; height: 200px; line-height: 200px; margin: 0 auto;
            border: 1px dashed #ccc; color: #aaa; font-size: 12px;
        }
        .label .code { font-size: 24px; font-weight: 800; letter-spacing: 3px; color: #1f2733; margin-top: 12px; }
        .toolbar { text-align: center; margin: 18px 0; }
        .toolbar button {
            background: #b08d35; color: #fff; border: 0; padding: 10px 22px;
            border-radius: 6px; font-size: 14px; cursor: pointer;
        }
        @media print {
            body { background: #fff; padding: 0; }
            .toolbar { display: none; }
            .label { border-color: #000; }
        }
    </style>
</head>
<body>
    <div class="label">
        <div class="brand">@lang('bms::lang.bms_module')</div>
        <div class="name">{{ $asset->name }}</div>
        <div class="cat">{{ __('bms::lang.cat_'.$asset->category) }} · {{ __('bms::lang.qty_short') }} {{ $asset->quantity }}</div>
        <div class="qr">
            @if ($qr)
                <img src="data:image/png;base64,{{ $qr }}" alt="QR {{ $asset->code }}">
            @else
                <div class="fallback">@lang('bms::lang.qr_unavailable')</div>
            @endif
        </div>
        <div class="code">{{ $asset->code }}</div>
    </div>
    <div class="toolbar">
        <button onclick="window.print()">@lang('bms::lang.print_label')</button>
    </div>
</body>
</html>
