/* Visual PDF templates: PdfVisualStudio, PdfVisualDesigner, PdfVisualForm.
   pdfme draws its own interface (antd) inside .pdv-host-canvas. */

.pdv-switch { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.pdv-switch button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 14px; border: 1px solid #E5E2DA; border-radius: 10px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.pdv-switch button strong { font-size: 13px; color: #111; }
.pdv-switch button span { font-size: 11px; color: #6b6760; }
.pdv-switch button.is-active { border-color: #2563EB; box-shadow: inset 0 0 0 1px #2563EB; }

.pdv { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px; font-size: 13px; color: #111; }
.pdv *, .pdv *::before, .pdv *::after { box-sizing: border-box; }
.pdv :focus-visible { outline: 3px solid rgb(37 99 235 / 35%); outline-offset: 2px; }
.pdv button { font: inherit; cursor: pointer; }
.pdv button:disabled { cursor: default; opacity: .5; }

.pdv-library { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; border: 1px solid #E5E2DA; border-radius: 10px; background: #fff; align-self: start; }
.pdv-library-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pdv-new { display: flex; gap: 4px; }
.pdv-new button, .pdv-library-actions button, .pdv-footer-row > button, .pdv-confirm button { min-height: 30px; padding: 0 10px; border: 1px solid #E5E2DA; border-radius: 7px; background: #fff; font-size: 12px; font-weight: 600; }
.pdv-new button:hover, .pdv-library-actions button:hover:not(:disabled) { border-color: #2563EB; color: #2563EB; }
.pdv-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.pdv-group { margin: 8px 0 2px; font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: #8a867e; }
.pdv-group:first-child { margin-top: 0; }
.pdv-item { display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 7px 9px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.pdv-item:hover { background: #f5f4f0; }
.pdv-item.is-active { background: #eef3ff; }
.pdv-item-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdv-item-meta { font-size: 11px; color: #6b6760; }
.pdv-library-actions { display: flex; gap: 6px; padding-top: 8px; border-top: 1px solid #F0EDE6; }

.pdv-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pdv-toolbar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.pdv-modes { display: inline-flex; padding: 2px; border: 1px solid #E5E2DA; border-radius: 8px; background: #fff; }
.pdv-modes button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 6px; background: transparent; font-size: 12px; font-weight: 600; color: #6b6760; }
.pdv-modes button.is-active { background: #111; color: #fff; }
.pdv-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 600; color: #6b6760; }
.pdv-field input { min-height: 32px; width: 220px; padding: 0 9px; border: 1px solid #E5E2DA; border-radius: 7px; background: #fff; font: inherit; font-size: 13px; font-weight: 400; color: #111; }
.pdv-field-narrow input { width: 150px; }
.pdv-field-grow { flex: 1; }
.pdv-field-grow input { width: 100%; }
.pdv-primary { min-height: 32px; margin-left: auto; padding: 0 16px; border: 1px solid #2563EB; border-radius: 7px; background: #2563EB; color: #fff; font-size: 12.5px; font-weight: 600; }
.pdv-primary:disabled { background: #fff; color: #6b6760; border-color: #E5E2DA; opacity: 1; }
.pdv-danger { color: #b91c1c !important; }
.pdv-hint { color: #6b6760; font-size: 12px; align-self: center; }
.pdv-footer-row { display: flex; align-items: flex-end; gap: 8px; }
.pdv-confirm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid #fde68a; border-radius: 8px; background: #fffbeb; color: #92400e; font-size: 12px; }
.pdv-message { margin: 0; color: #15803d; font-size: 12.5px; }
.pdv-message-error { color: #b91c1c; }
.pdv-summary { margin: 0; color: #6b6760; font-size: 11.5px; }
.pdv-empty { display: grid; place-items: center; min-height: 320px; border: 1px dashed #d7d3ca; border-radius: 10px; color: #6b6760; }

.pdv-host { position: relative; width: 100%; min-height: 480px; border: 1px solid #E5E2DA; border-radius: 10px; overflow: hidden; background: #f4f3ef; }
.pdv-host-canvas { position: absolute; inset: 0; }
.pdv-host-status { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: #6b6760; font-weight: 600; pointer-events: none; }
.pdv-host-error { color: #b91c1c; background: #fef2f2; }

/* Full-screen demo frame: the designer takes the height. */
.pb-demo-shell:fullscreen .pdv-host,
.pb-demo-shell.is-maximized .pdv-host { height: calc(100dvh - 210px) !important; }

@media (max-width: 900px) {
    .pdv { grid-template-columns: 1fr; }
    .pdv-primary { margin-left: 0; }
}
