:root { --zoom: 1; --bg-canvas: #e0e0e0; --panel-width: 280px; } 
html, body { height: 100%; margin: 0; padding: 0; overflow: hidden; }
body { background: #f8f9fa; display: flex; flex-direction: column; font-family: 'Segoe UI', sans-serif; user-select: none; }
.main-content { flex: 1; display: flex; flex-direction: column; background: #fff; overflow: hidden; height: 100%; }
.nav-tabs { background: #fff; padding: 8px 15px 0; border-bottom: 1px solid #dee2e6; flex-shrink: 0; }
.nav-tabs .nav-link { color: #6c757d; border:none; border-bottom: 3px solid transparent; font-weight: 500; }
.nav-tabs .nav-link:hover { color: #333; }
.nav-tabs .nav-link.active { color: #0d6efd; font-weight: bold; border-bottom: 3px solid #0d6efd; }
.tab-content { flex: 1; position: relative; overflow: hidden; }
.tab-pane { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: white; display: none; flex-direction: column; }
.tab-pane.show { display: flex !important; z-index: 10; }
.designer-grid { display: grid; grid-template-columns: var(--panel-width) 1fr var(--panel-width); height: 100%; width: 100%; }
.p-left { background: #fff; border-right: 1px solid #dee2e6; display: flex; flex-direction: column; padding: 0; z-index: 2; overflow-y: auto; }
.tools-container { padding: 15px; }
.tool-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #adb5bd; font-weight: 700; margin-top: 20px; margin-bottom: 8px; }
.tool-section-title:first-child { margin-top: 0; }
.tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; cursor: pointer; transition: all 0.2s; color: #555; }
.tool-btn i { font-size: 20px; margin-bottom: 5px; color: #444; }
.tool-btn span { font-size: 11px; font-weight: 500; }
.tool-btn:hover { background: #fff; border-color: #0d6efd; color: #0d6efd; transform: translateY(-2px); box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.tool-btn:hover i { color: #0d6efd; }
.p-center { background: var(--bg-canvas); position: relative; display: flex; flex-direction: column; overflow: hidden; }
.top-toolbar { height: 50px; background: #fff; border-bottom: 1px solid #dee2e6; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; flex-shrink: 0; box-shadow: 0 2px 5px rgba(0,0,0,0.03); z-index: 5; }
.align-group { display: flex; gap: 4px; border-right: 1px solid #eee; padding-right: 10px; margin-right: 10px; }
.btn-icon { width: 32px; height: 32px; border: none; background: transparent; border-radius: 4px; color: #555; display: flex; align-items: center; justify-content: center; transition: 0.1s; }
.btn-icon:hover { background: #f0f0f0; color: #000; }
.cvs-con { flex: 1; display: flex; justify-content: center; align-items: center; overflow: hidden; position: relative; }
.cvs-area { background: #fff; box-shadow: 0 0 20px rgba(0,0,0,0.2); position: relative; transform-origin: center center; cursor: default; overflow: hidden; }
.safe-zone { position: absolute; border: 1px dashed rgba(0, 0, 0, 0.2); box-shadow: 0 0 0 9999px rgba(255, 235, 59, 0.25); pointer-events: none; z-index: 1; }
.p-right { background: #fff; border-left: 1px solid #dee2e6; display: flex; flex-direction: column; overflow-y: auto; padding: 0; z-index: 2; }
.prop-header { padding: 10px 15px; background: #f8f9fa; border-bottom: 1px solid #eee; font-weight: 600; font-size: 13px; color: #444; display: flex; align-items: center; }
.prop-body { padding: 15px; flex: 1; overflow-y: auto; }
.d-item { position: absolute; cursor: grab; display: flex; flex-direction: column; justify-content: center; align-items: center; box-sizing: border-box; white-space: nowrap; }
.d-item:active { cursor: grabbing; }
.d-item.selected { outline: 2px solid #0d6efd; z-index: 1000; }
.d-item.linked { outline: 2px dotted #198754; }
.d-item img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.d-item canvas { width: 100%; height: 100%; pointer-events: none; }
.d-item-text { pointer-events: none; white-space: pre-wrap; text-align: center; width: 100%; height: 100%; display:flex; align-items:center; justify-content:center; overflow: hidden; }
.qr-container { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; pointer-events: none; }
.qr-container img { width: 100% !important; height: 100% !important; object-fit: contain; }
.h-res { position: absolute; width: calc(10px / var(--zoom)); height: calc(10px / var(--zoom)); background: #fff; border: 1px solid #0d6efd; right: calc(-5px / var(--zoom)); bottom: calc(-5px / var(--zoom)); cursor: nwse-resize; z-index: 9999; display: none; }
.h-rot { position: absolute; width: calc(10px / var(--zoom)); height: calc(10px / var(--zoom)); background: #20c997; border: 1px solid #fff; left: 50%; top: calc(-20px / var(--zoom)); transform: translateX(-50%); cursor: grab; z-index: 9999; display: none; border-radius: 50%; }
.h-stick { position: absolute; width: 1px; height: calc(20px / var(--zoom)); background: #20c997; left: 50%; top: calc(-20px / var(--zoom)); display: none; z-index: 9998; }
.d-item.selected .h-res, .d-item.selected .h-rot, .d-item.selected .h-stick { display: block; }
.db-status { font-size: 11px; padding: 6px; border-radius: 4px; background: #eee; text-align: center; margin-bottom: 0; color: #777; }
.db-status.active { background: #d1e7dd; color: #0f5132; }
.layer-item { padding: 6px 10px; border-bottom: 1px solid #f0f0f0; cursor: pointer; font-size: 12px; display:flex; justify-content:space-between; align-items:center; }
.layer-item:hover { background: #f9f9f9; }
.layer-item.active { background: #eef2ff; color: #0d6efd; font-weight: bold; border-left: 3px solid #0d6efd; }
.inp-grp-lbl { font-size: 10px; color: #888; margin-bottom: 2px; display:block; }
.form-control-xs { font-size: 12px; padding: 4px 6px; height: auto; }
.pr-card { background: #fff; border: 1px solid #eee; border-radius: 6px; padding: 10px; margin-bottom: 8px; }
.pr-row-main { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pr-row-details { display: flex; align-items: center; gap: 8px; background: #f8f9fa; padding: 10px; border-radius: 4px; flex-wrap: wrap; font-size: 12px; }
.pr-inp-mini { border: 1px solid #ddd; border-radius: 3px; padding: 3px 5px; width: 60px; text-align: center; font-weight: 500; }
.pr-lbl-mini { color: #555; margin-right: 2px; font-weight: 500;}
.pr-group { display: flex; align-items: center; margin-right: 15px; }
.pvz-table-con { flex: 1; overflow-y: auto; background: #fff; height: 100%; }
.pvz-row { padding: 10px 15px; border-bottom: 1px solid #f0f0f0; cursor: pointer; display: flex; align-items: center; transition: background 0.1s; }
.pvz-row:nth-child(even) { background-color: #fcfcfc; }
.pvz-row:hover { background: #f8f9fa; }
.pvz-id { font-weight: 700; color: #0d6efd; min-width: 60px; margin-right: 15px; font-family: monospace; font-size: 14px; text-align: center; background: #f0f0f0; padding: 2px 5px; border-radius: 4px; }
.pvz-name { font-size: 14px; color: #333; font-weight: 500; }
.q-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid #eee; font-size: 13px; background: #fff; }
.q-name { width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; flex-shrink: 0; }