/* HUU 9.0.56 — invoice theme gallery. Other application UI is untouched. */
.huu-template-gallery{margin-top:18px}
.huu-templates-heading{display:flex;gap:15px;align-items:start;justify-content:space-between;margin-bottom:18px}
.huu-templates-heading h2{margin:0 0 6px;color:#18212b;font-weight:650;font-size:19px}
.huu-templates-heading p{margin:0;color:#52606c;font-size:13px;line-height:1.5}
#huu-template-count{font-size:12px;color:#66717a;white-space:nowrap;padding-top:6px}
.huu-template-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;align-items:stretch;min-width:0}
.huu-template-card{min-width:0;display:flex;flex-direction:column;gap:7px;align-items:stretch;padding:10px;border:1px solid #d7dfe3;background:#fff;color:#161e24;border-radius:12px;text-align:left;cursor:pointer;box-shadow:none;filter:none;opacity:1;transform:none;transition:border-color .15s,box-shadow .15s}
.huu-template-card:hover,.huu-template-card:focus-visible{filter:none!important;opacity:1!important;transform:none!important;border-color:#e77930;box-shadow:0 0 0 2px rgba(244,130,35,.12);outline:none}
.huu-template-card.is-selected{border:2px solid #ee7927;padding:9px;box-shadow:0 0 0 2px rgba(244,130,35,.1)}
.huu-template-card.is-locked{cursor:default}
.huu-template-mini{background:#f3f5f6;border:1px solid #e8ebee;border-radius:4px;aspect-ratio:595 / 842;overflow:hidden;display:flex;justify-content:center;align-items:center;position:relative}
.huu-template-mini img{display:block;width:100%;height:100%;object-fit:contain;image-rendering:auto}
.huu-template-mini-loading{font-size:10px;text-align:center;color:#8a929b;padding:8px}
.huu-template-meta{display:flex;flex-direction:column;gap:2px;line-height:1.3}
.huu-template-meta strong{font-size:13px;color:#162127;font-weight:650}
.huu-template-meta small{font-size:11px;color:#616e77;font-weight:400}
.huu-template-selected,.huu-template-lock{font-size:11px;line-height:1.4;font-weight:600;color:#a94e0e}
.huu-template-lock{color:#6a7880}
.huu-template-field{display:grid;grid-template-columns:minmax(180px,245px) auto;gap:8px 12px;align-items:end;margin:16px 0;padding:15px;border:1px solid #e3e8eb;border-radius:13px;background:#fafbfc}
.huu-template-field>label{display:block;grid-column:1/-1;font-size:13px;font-weight:600;margin:0;color:#263039}
.huu-template-field select{max-width:245px;width:100%;font-weight:500}
.huu-template-field>button{justify-self:start;min-height:40px;font-size:12px}
#huu-invoice-template-preview-panel{grid-column:1/-1;grid-template-columns:repeat(5,minmax(0,1fr));margin-top:12px}
#huu-invoice-template-preview-panel[hidden],#invoice-template-gallery[hidden]{display:none!important}
.huu-detail-template{font-size:12px;color:#596774;margin:3px 0 14px}
@media(max-width:1050px){.huu-template-grid,#huu-invoice-template-preview-panel{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:650px){.huu-template-grid,#huu-invoice-template-preview-panel{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.huu-template-field{grid-template-columns:1fr}.huu-template-field select{max-width:none}.huu-template-card{padding:9px}.huu-template-card.is-selected{padding:8px}}

/* HUU 9.0.56 — paid-on-create toggle and demo transfer, without changing the approved app layout */
.huu-paid-on-create{display:flex;align-items:center;gap:18px;flex-wrap:wrap;padding:12px 14px;border:1px solid #d8e3de;border-radius:11px;background:#f9fcfa;margin:12px 0}
.huu-paid-on-create[hidden],.huu-paid-date[hidden],.huu-demo-transfer[hidden]{display:none!important}
.huu-paid-check{display:inline-flex;align-items:center;gap:10px;font-size:14px;font-weight:600;color:#152c24;white-space:nowrap}
.huu-paid-check input{width:18px;height:18px;accent-color:#257b56;margin:0;flex-shrink:0}
.huu-paid-date{display:flex;align-items:center;gap:9px;font-weight:500;font-size:13px;color:#233e33}
.huu-paid-date input{min-width:155px;width:155px;height:36px;background:#fff;border:1px solid #c4d0c8;border-radius:7px;padding:5px 9px;font-size:14px;color:#172e24}
.huu-demo-transfer{margin-block:16px}
.huu-demo-transfer p{max-width:900px;line-height:1.6}
.huu-demo-transfer-actions{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}
.huu-demo-import-label{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;min-height:38px;font-size:13px}
@media(max-width:620px){.huu-paid-on-create{align-items:stretch;flex-direction:column;gap:11px}.huu-paid-date{justify-content:space-between}.huu-demo-transfer-actions{flex-direction:column}}

/* 9.0.58 – full-page A4 preview is the primary choice, thumbnails are secondary. */
.huu-template-full{margin:10px 0 20px;display:flex;flex-direction:column;align-items:center;gap:12px}
.huu-template-full-head{display:flex;align-items:center;justify-content:space-between;gap:15px;width:min(100%,630px)}
.huu-template-full-head>div{display:flex;flex-direction:column;gap:4px}
.huu-template-full-head strong{font-size:17px;font-weight:650;color:#172018}
.huu-template-full-head span{font-size:13px;color:#68726c}
.huu-template-full-paper{width:min(100%,620px);min-height:180px;background:#fff;border:1px solid #d8dedb;box-shadow:0 12px 35px rgba(21,45,29,.09);border-radius:5px;overflow:hidden;aspect-ratio:595/842}
.huu-template-full-paper img{display:block;width:100%;height:auto;aspect-ratio:595/842;object-fit:contain}
.huu-template-full-info{max-width:620px;text-align:center;color:#6b756f;font-size:12px!important;line-height:1.55;margin:0 0 8px}
.huu-template-chooser-label{font-weight:600;color:#26322b;margin:12px 0 13px}
.huu-template-card.is-previewing{outline:2px solid #326447;outline-offset:2px}
.huu-template-zoom-dialog{max-height:95dvh;width:min(96vw,820px);padding:12px;border:1px solid #dce4dc;border-radius:12px;overflow:auto}
.huu-template-zoom-dialog::backdrop{background:rgba(14,22,18,.72)}
.huu-template-zoom-head{position:sticky;top:-12px;background:#fff;display:flex;align-items:center;justify-content:space-between;gap:12px;z-index:2;padding:8px 6px;margin-bottom:10px;border-bottom:1px solid #e5ebe7}
.huu-template-zoom-dialog img{display:block;width:100%;height:auto;max-width:775px;margin:auto}
@media(max-width:650px){.huu-template-full-head{flex-wrap:wrap}.huu-template-full-head button{min-height:36px}.huu-template-full{margin:0 0 17px}}
