<!DOCTYPE html>
<html lang="<?php echo e(str_replace('_', '-', app()->getLocale())); ?>">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php echo e($medicalRecord->title ?: __('Consulta')); ?> — <?php echo e($patient->name); ?></title>
    <style>
        body { font-family: system-ui, Segoe UI, Roboto, sans-serif; color: #111; line-height: 1.45; max-width: 48rem; margin: 0 auto; padding: 1.5rem; }
        h1 { font-size: 1.25rem; margin: 0 0 0.25rem; }
        .muted { color: #555; font-size: 0.875rem; }
        .box { border: 1px solid #ccc; border-radius: 8px; padding: 1rem; margin-top: 1rem; }
        .label { font-weight: 600; color: #000; }
        .block { margin-top: 0.75rem; white-space: pre-wrap; }
        .toolbar { margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
        .btn { display: inline-block; padding: 0.5rem 1rem; background: #6d28d9; color: #fff !important; text-decoration: none; border-radius: 8px; font-weight: 600; border: none; cursor: pointer; font-size: 0.875rem; }
        .btn:hover { background: #5b21b6; }
        ul.att { list-style: none; padding: 0; margin: 0.5rem 0 0; }
        ul.att li { padding: 0.35rem 0; border-bottom: 1px solid #eee; font-size: 0.875rem; }
        @media print {
            .toolbar { display: none; }
            body { padding: 0; }
            .box { break-inside: avoid; }
        }
    </style>
</head>
<body>
    <div class="toolbar">
        <button type="button" class="btn" onclick="window.print()"><?php echo e(__('Imprimir / PDF')); ?></button>
        <a class="btn" style="background:#0f766e;" href="<?php echo e(route('clients.patients.medical-records.show', [$client, $patient, $medicalRecord])); ?>"><?php echo e(__('Volver a la ficha')); ?></a>
    </div>

    <p class="muted"><?php echo e(config('app.name')); ?></p>
    <h1><?php echo e($medicalRecord->title ?: __('Entrada clínica')); ?></h1>
    <p class="muted">
        <?php echo e($patient->name); ?>

        <?php if($patient->clinical_code): ?>
            · <?php echo e(__('ID')); ?>: <?php echo e($patient->clinical_code); ?>

        <?php endif; ?>
        · <?php echo e(__('Titular')); ?>: <?php echo e($client->name); ?>

    </p>
    <p class="muted">
        <?php echo e($medicalRecord->recorded_at->translatedFormat('d M Y H:i')); ?>

        <?php if($medicalRecord->author): ?>
            · <?php echo e(__('Por')); ?> <?php echo e($medicalRecord->author->name); ?>

        <?php endif; ?>
    </p>

    <div class="box">
        <?php if($medicalRecord->weight_kg): ?>
            <p><span class="label"><?php echo e(__('Peso')); ?>:</span> <?php echo e($medicalRecord->weight_kg); ?> kg</p>
        <?php endif; ?>
        <?php if($medicalRecord->temperature_c): ?>
            <p><span class="label"><?php echo e(__('Temperatura')); ?>:</span> <?php echo e($medicalRecord->temperature_c); ?> °C</p>
        <?php endif; ?>
        <?php if($medicalRecord->chief_complaint): ?>
            <p><span class="label"><?php echo e(__('Motivo de consulta')); ?>:</span> <?php echo e($medicalRecord->chief_complaint); ?></p>
        <?php endif; ?>
        <?php if($medicalRecord->physical_exam): ?>
            <div class="block"><span class="label"><?php echo e(__('Examen físico')); ?></span><br><?php echo e($medicalRecord->physical_exam); ?></div>
        <?php endif; ?>
        <?php if($medicalRecord->diagnosis): ?>
            <div class="block"><span class="label"><?php echo e(__('Diagnóstico')); ?></span><br><?php echo e($medicalRecord->diagnosis); ?></div>
        <?php endif; ?>
        <?php if($medicalRecord->treatment): ?>
            <div class="block"><span class="label"><?php echo e(__('Tratamiento')); ?></span><br><?php echo e($medicalRecord->treatment); ?></div>
        <?php endif; ?>
        <?php if($medicalRecord->medications): ?>
            <div class="block"><span class="label"><?php echo e(__('Medicación')); ?></span><br><?php echo e($medicalRecord->medications); ?></div>
        <?php endif; ?>
        <?php if($medicalRecord->body): ?>
            <div class="block"><span class="label"><?php echo e(__('Notas adicionales')); ?></span><br><?php echo e($medicalRecord->body); ?></div>
        <?php endif; ?>
    </div>

    <?php if($medicalRecord->attachments->isNotEmpty()): ?>
        <div class="box">
            <p class="label"><?php echo e(__('Adjuntos')); ?></p>
            <ul class="att">
                <?php $__currentLoopData = $medicalRecord->attachments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $att): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li>
                        <?php echo e($att->original_name); ?>

                        — <a href="<?php echo e(\Illuminate\Support\Facades\Storage::url($att->path)); ?>"><?php echo e(__('Abrir')); ?></a>
                    </li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul>
        </div>
    <?php endif; ?>
</body>
</html>
<?php /**PATH C:\wamp64\www\vet\resources\views/medical_records/print.blade.php ENDPATH**/ ?>