/* Styles */
.alfpf-form { background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:20px; max-width:900px; margin:20px auto; box-shadow:0 10px 20px rgba(0,0,0,0.06); }
.alfpf-form h3 { margin-top:0; }
.alfpf-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:12px; }
.alfpf-grid label { display:flex; flex-direction:column; font-weight:500; font-size:14px; }
.alfpf-grid input, .alfpf-grid textarea { margin-top:6px; padding:10px; border:1px solid #d1d5db; border-radius:8px; font-size:14px; }
.alfpf-leave-type { margin-top:16px; border:1px dashed #d1d5db; border-radius:8px; padding:12px; }
.alfpf-leave-type label { display:inline-flex; align-items:center; gap:8px; margin-right:16px; }
.alfpf-actions { margin-top:16px; }
.alfpf-btn { background:#0f172a; color:#fff; padding:10px 16px; border-radius:8px; text-decoration:none; border:none; cursor:pointer; display:inline-block; }
.alfpf-result { margin-top:12px; padding:12px; background:#ecfdf5; border:1px solid #10b981; border-radius:8px; }

/* Preview layout */
.alfpf-view { max-width:900px; margin:18px auto; }
.alfpf-card { background:#fff; border:1px solid #e5e7eb; border-radius:12px; overflow:hidden; box-shadow:0 10px 20px rgba(0,0,0,.08); }
.alfpf-topbar { position:sticky; top:0; background:#0f172a; color:#fff; padding:10px 12px; display:flex; gap:8px; align-items:center; z-index:5; }
.spacer{ flex:1; }
.alfpf-a4 { position:relative; width:210mm; min-height:297mm; margin:0 auto; background:#fff; box-shadow:0 10px 20px rgba(0,0,0,.06); }
.alfpf-a4-bg { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:#fff; }
.alfpf-overlay { position:absolute; white-space:pre-wrap; line-height:1.2; color:#000; }

/* PRINT: Only print the A4 sheet, hide UI */
@page { size: A4; margin: 0; }
@media print {
  html, body { width:210mm; height:297mm; background:#fff !important; }
  /* Hide everything by default */
  body * { visibility: hidden !important; }
  /* Show only the A4 sheet and its children */
  .alfpf-a4, .alfpf-a4 * { visibility: visible !important; }
  /* Position the sheet at (0,0) and ensure exact A4 size */
  .alfpf-a4 { position: absolute !important; left: 0 !important; top: 0 !important; width:210mm !important; height:297mm !important; margin:0 !important; box-shadow:none !important; border:0 !important; }
  /* Remove page chrome */
  .alfpf-topbar, .alfpf-card, .alfpf-view { border:0 !important; box-shadow:none !important; }
}