/* مصمم الفاتورة */
.dz { display: flex; flex-direction: column; gap: 8px; }
.dz-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 10px !important; }
.dz-bar .f { min-height: 30px; } .dz-bar #dz-tpl { min-width: 200px; }
.dz-sep { width: 1px; height: 22px; background: var(--stroke-hi, #ccc); margin: 0 4px; }
.dz-grid3 { display: grid; grid-template-columns: 210px minmax(0, 1fr) 290px; gap: 8px; align-items: start; }
.dz-left, .dz-right { max-height: 74vh; overflow: auto; padding: 8px 10px !important; }
.dz-left h4, .dz-right h4 { margin: 0 0 6px; font-size: 13px; }
.dz-item { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; border-radius: 8px; cursor: pointer; font-size: 12.5px; border: 1px solid transparent; }
.dz-item:hover { background: rgba(22,163,74,.08); } .dz-item.on { background: rgba(22,163,74,.18); border-color: #16a34a; } .dz-item.off { opacity: .45; }
.dz-stagewrap { overflow: auto; max-height: 78vh; background: #7b828c; border-radius: 10px; padding: 8px; }
.dz-stage { position: relative; margin: 0 auto; padding: 12px; touch-action: none; user-select: none; --gs: 20px;
  background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: var(--gs) var(--gs); }
.dz-stage.nogrid { background-image: none; }
.dz-paper { box-shadow: 0 6px 26px rgba(0,0,0,.45); background: #fff; margin: 12px 0 0 12px; position: relative; overflow: visible; }
.dz-paper [data-el]:hover { outline: 1px dashed #16a34a; }
#dz-ov { position: absolute; inset: 0; pointer-events: none; }
.dz-sel { position: absolute; border: 2px solid #2563eb; box-sizing: border-box; pointer-events: none; }
/* خطوط المحاذاة وانت بتسحب (لون ظاهر على الورق الأبيض والشبكة) */
.dz-guide { position: absolute; pointer-events: none; z-index: 6; background: #ff1f8e; box-shadow: 0 0 0 .5px rgba(255,255,255,.6); }
.dz-guide.v { width: 1px; }
.dz-guide.h { height: 1px; }
.dz-h { position: absolute; width: 10px; height: 10px; background: #2563eb; border: 1px solid #fff; border-radius: 2px; pointer-events: auto; }
.dz-h[data-h=se] { right: -6px; bottom: -6px; cursor: nwse-resize; } .dz-h[data-h=sw] { left: -6px; bottom: -6px; cursor: nesw-resize; }
.dz-h[data-h=ne] { right: -6px; top: -6px; cursor: nesw-resize; } .dz-h[data-h=nw] { left: -6px; top: -6px; cursor: nwse-resize; }
.dz-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; } .dz-g2 .fld label { font-size: 11px; }
.dz-col { display: grid; grid-template-columns: 24px 1fr 46px 62px 26px 26px; gap: 3px; align-items: center; margin-bottom: 3px; } .dz-col .f { min-height: 26px; padding: 1px 4px; }
.dz-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; margin: 4px 0; }
@media (max-width: 1100px) { .dz-grid3 { grid-template-columns: 1fr; } .dz-left, .dz-right { max-height: none; } }
@media print { .dz { display: none; } }
.dz-stage { direction: ltr; }

.dz-libg { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 8px; }
.dz-lc { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border: 1px solid var(--stroke, #ccc); border-radius: 10px; background: rgba(255,255,255,.55); }
.dz-lc.on { outline: 2px solid #2563eb; } .dz-lc.act { border-color: #16a34a; background: rgba(22,163,74,.10); }
.dz-lc small { color: #556; font-size: 11.5px; }
.dz-bar > select.f { width: auto !important; flex: 0 0 auto; min-width: 150px; max-width: 260px; }
