/* BusinessTemplates widget (public/js/widgets/biztemplates.js) */
.bt .toast { pointer-events: auto; }
.bt-side { width: 236px; flex: none; border-top: 1px solid var(--border); border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; background: var(--muted); }
.bt-sbox input, .bt-nin input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; font: inherit; color: inherit; height: 30px; }
.bt-sbox:focus-within, .bt-nin:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent); }
.bt-list { flex: 1; overflow: auto; padding: 0 8px 8px; }
.bt-gh { font-size: 11.5px; color: var(--muted-foreground); padding: 10px 6px 4px; }
.bt-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; position: relative; transition: background .15s; }
.bt-row:hover, .bt-row.sel { background: var(--accent); }
.bt-row.sel { box-shadow: inset 2px 0 0 var(--primary); }
.bt-ri { width: 26px; height: 26px; flex: none; border-radius: 7px; display: grid; place-items: center; background: var(--card); color: var(--muted-foreground); border: 1px solid var(--border); }
.bt-rt { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.bt-rt b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-rt small { font-size: 11px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-rp { position: absolute; inset-inline: 42px 10px; bottom: 2px; height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--foreground) 8%, transparent); overflow: hidden; }
.bt-rp i { display: block; height: 100%; background: var(--primary); transition: width .4s var(--ease); }
.bt-rm { opacity: 0; transition: opacity .15s; }
.bt-row:hover .bt-rm, .bt-row.sel .bt-rm { opacity: 1; }
.bt-own { padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.bt-main { flex: 1; min-width: 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; position: relative; }
.bt-head { padding: 8px 18px; border-bottom: 1px solid var(--border); }
.bt-crumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-foreground); }
.bt-crumb .btn[aria-pressed="true"] { color: var(--primary); }
.bt-trow { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.bt-title { flex: 1; min-width: 0; font-family: Morabba; font-size: 24px; font-weight: 700; line-height: 1.35; outline: 0; white-space: nowrap; overflow: hidden; }
.bt-title:empty::before, .bt-nt:empty::before, .bt-st:empty::before { content: attr(data-ph); color: var(--muted-foreground); opacity: .6; }
.bt-prog { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.bt-ring { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--p) * 1%), color-mix(in srgb, var(--foreground) 10%, transparent) 0); -webkit-mask: radial-gradient(circle, transparent 6px, #000 6.5px); mask: radial-gradient(circle, transparent 6px, #000 6.5px); }
.bt-body { flex: 1; min-height: 0; padding: 12px 14px; overflow: hidden; }

/* canvas */
.bt-cv { display: grid; gap: 6px; height: 100%; }
.bt-blk { --bc: var(--foreground); min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; background: var(--card); overflow: hidden; border-top: 3px solid color-mix(in srgb, var(--bc) 55%, transparent); }
.bt-bh { display: flex; align-items: center; gap: 4px; padding: 5px 4px 3px; padding-inline-start: 9px; }
.bt-bt { flex: 1; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-bn { font-size: 11px; color: var(--muted-foreground); }
.bt-notes { flex: 1; min-height: 0; overflow: auto; padding: 2px 6px 6px; display: flex; flex-direction: column; gap: 4px; }
.bt-hint { font-size: 11.5px; line-height: 1.7; color: var(--muted-foreground); opacity: .85; padding: 2px 3px; }
.bt-note { position: relative; border-radius: 6px; background: color-mix(in srgb, var(--c) 16%, var(--card)); border-inline-start: 3px solid var(--c); padding: 4px 8px; padding-inline-end: 20px; }
.bt-nt { font-size: 12px; line-height: 1.6; outline: 0; min-height: 1.6em; word-break: break-word; }
.bt-nx { position: absolute; top: 3px; inset-inline-end: 2px; width: 18px; height: 18px; border: 0; background: transparent; border-radius: 4px; color: var(--muted-foreground); cursor: pointer; display: grid; place-items: center; opacity: 0; }
.bt-nx .i { width: 12px; height: 12px; }
.bt-note:hover .bt-nx, .bt-note:focus-within .bt-nx { opacity: 1; }
.bt-nx:hover { background: var(--muted); color: var(--red); }

/* doc */
.bt-doc { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 14px; height: 100%; }
.bt-toc { overflow: auto; display: grid; align-content: start; gap: 2px; }
.bt-ti { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; text-align: start; padding: 6px 8px; border-radius: 7px; font: inherit; font-size: 12.5px; color: var(--foreground); cursor: pointer; }
.bt-ti:hover { background: var(--muted); }
.bt-tn { width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--muted); color: var(--muted-foreground); border: 1px solid var(--border); transition: all .2s; }
.bt-ti.ok .bt-tn { background: var(--success-ink); color: #fff; border-color: transparent; }
.bt-secs { overflow: auto; padding-inline-end: 4px; display: grid; gap: 10px; align-content: start; position: relative; }
.bt-sec { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; background: var(--card); }
.bt-sec h6 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-family: Morabba; font-size: 17px; font-weight: 600; }
.bt-pr { margin: 0 0 6px; padding-inline-start: 18px; font-size: 12px; color: var(--muted-foreground); line-height: 1.8; }
.bt-st { min-height: 44px; border-radius: 8px; background: var(--field-empty); border: 1px dashed var(--border); padding: 8px 10px; font-size: 13.5px; line-height: 1.9; outline: 0; white-space: pre-wrap; }
.bt-st:focus { border-style: solid; border-color: var(--ring); }

/* table + fin */
.bt-tw, .bt-fin { height: 100%; overflow: auto; }
.bt-fin .bt-tb th, .bt-fin .bt-tb td { padding: 6px 10px; }
.bt-tb { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.bt-tb th, .bt-tb td { padding: 8px 10px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: top; }
.bt-tb thead th { background: var(--muted); font-weight: 600; font-size: 12.5px; color: var(--muted-foreground); }
.bt-tb tbody tr:last-child > * { border-bottom: 0; }
.bt-tb td[contenteditable] { outline: 0; cursor: text; }
.bt-tb td[contenteditable]:focus { box-shadow: inset 0 0 0 2px var(--ring); background: var(--field-filled); }
.bt-tb .num { text-align: end; font-variant-numeric: tabular-nums; }
.bt-tb tbody th { font-weight: 600; background: color-mix(in srgb, var(--muted) 60%, transparent); white-space: nowrap; }
.bt-tb tfoot td { background: var(--muted); font-size: 12px; font-weight: 600; border-top: 1px solid var(--border); border-bottom: 0; }
.bt-tb tr.bt-comp td { color: var(--muted-foreground); }
.bt-tb tr.strong td, .bt-tb tr.strong th { font-weight: 700; color: var(--foreground); }
.bt-chart { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.bt-ct { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.bt-lg { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 5px; font-weight: 400; color: var(--muted-foreground); font-size: 11.5px; }
.bt-lg i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-inline-start: 6px; }

/* calc */
.bt-calcw { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; height: 100%; }
.bt-note2 { display: flex; gap: 6px; font-size: 12px; line-height: 1.8; color: var(--muted-foreground); background: var(--muted); border-radius: 8px; padding: 8px 10px; }
.bt-out { min-width: 0; overflow: auto; }
.bt-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bt-oc { --c: var(--foreground); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; display: grid; gap: 1px; }
.bt-oc small { font-size: 11.5px; color: var(--muted-foreground); }
.bt-oc b { font-family: Morabba; font-size: 24px; color: var(--c); line-height: 1.3; }
.bt-oc span { font-size: 11.5px; color: var(--muted-foreground); }
.bt-oc em { font-style: normal; font-size: 11.5px; color: var(--c); }
.bt-oc.key { background: color-mix(in srgb, var(--primary) 8%, var(--card)); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.bt-grow { transform-box: fill-box; transform-origin: right; animation: bt-grow .6s var(--ease) both; }
@keyframes bt-grow { from { transform: scaleX(0); } }

/* gallery */
.dlg.bt-gal { width: 760px; padding: 16px 18px; }
.bt-gg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 392px; overflow: auto; padding: 2px; }
.bt-card { display: flex; gap: 10px; align-items: flex-start; text-align: start; border: 1px solid var(--border); background: var(--card); border-radius: 10px; padding: 10px; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, background .15s; position: relative; }
.bt-card:hover { background: var(--muted); }
.bt-card.sel { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
.bt-ci { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 12%, var(--card)); color: var(--primary); }
.bt-cb { flex: 1; min-width: 0; display: grid; gap: 1px; padding-inline-end: 38px; }
.bt-cb b { font-size: 13px; }
.bt-cb small { font-size: 10.5px; color: var(--muted-foreground); text-align: end; }
.bt-cb span { font-size: 11.5px; line-height: 1.6; color: var(--muted-foreground); }
.bt-card .pill { position: absolute; top: 8px; inset-inline-end: 8px; height: 18px; font-size: 10.5px; padding: 0 7px; }
.bt-gf { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.bt-gs { flex: 1; font-size: 12.5px; }
