.pdf-toolbar{display:flex;gap:6px;align-items:center;flex-wrap:wrap;padding:8px;position:relative}.pdf-toolbar button,.pdf-toolbar select{min-height:38px;padding:6px 10px;border:1px solid #cbd5e1;border-radius:7px;background:#fff;color:#18362e;font:inherit;cursor:pointer}.pdf-toolbar button:disabled{opacity:.45}.pdf-toolbar input[type=color]{width:38px;height:38px}.pdf-toolbar+span{display:block;font-size:12px;padding:4px 10px;color:#52655c}

/* Dải nút icon công cụ vẽ */
.pdf-tool-group{display:inline-flex;align-items:center;background:#f1f5f9;border:1.5px solid #cbd5e1;border-radius:8px;padding:2px;gap:2px;flex-wrap:wrap}
.pdf-tool-btn{border:none!important;background:transparent!important;border-radius:6px!important;padding:5px 8px!important;min-height:34px!important;min-width:34px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;color:#334155!important;cursor:pointer;transition:all .15s ease}
.pdf-tool-btn svg{width:18px;height:18px;display:block;pointer-events:none}
.pdf-tool-btn:hover{background:#e2e8f0!important;color:#0f172a!important}
.pdf-tool-btn.active{background:#0284c7!important;color:#ffffff!important;box-shadow:0 1px 3px rgba(2,132,199,0.3)!important}
.pdf-tool-btn.danger.active{background:#ef4444!important;color:#ffffff!important;box-shadow:0 1px 3px rgba(239,68,68,0.3)!important}

/* Nút swatch màu sắc trên toolbar */
.pdf-color-trigger{display:inline-flex;align-items:center;gap:6px;padding:4px 8px!important;min-height:38px;background:#fff;border:1.5px solid #cbd5e1;border-radius:7px;cursor:pointer}
.pdf-color-circle{width:20px;height:20px;border-radius:50%;border:1.5px solid #64748b;display:inline-block;box-shadow:inset 0 0 2px rgba(0,0,0,0.2)}

/* Popover bảng màu cơ bản */
.pdf-palette-popover{position:absolute;top:calc(100% + 4px);left:10px;z-index:99999;background:#ffffff;border:1.5px solid #94a3b8;border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,0.18);padding:12px;width:280px;display:flex;flex-direction:column;gap:10px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif}
.pdf-palette-header{display:flex;justify-content:space-between;align-items:center;font-size:12px;font-weight:700;color:#334155}
.pdf-palette-colors{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.pdf-palette-swatch{width:100%;height:34px;border-radius:6px;border:2px solid transparent;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,0.1);display:inline-flex;align-items:center;justify-content:center;transition:transform .1s}
.pdf-palette-swatch:hover{transform:scale(1.05)}
.pdf-palette-swatch.active{border-color:#0284c7;outline:2px solid #38bdf8}
.pdf-palette-tabs{display:flex;background:#e2e8f0;border-radius:8px;padding:3px;gap:3px}
.pdf-palette-tab{flex:1;border:none;background:transparent;padding:6px 8px;font-size:11px;font-weight:600;border-radius:6px;cursor:pointer;color:#475569;min-height:28px!important;transition:all .15s ease}
.pdf-palette-tab.active{background:#0284c7!important;color:#ffffff!important;font-weight:700!important;box-shadow:0 2px 4px rgba(2,132,199,0.35)}
.pdf-opacity-row{display:flex;flex-direction:column;gap:4px}
.pdf-opacity-header{display:flex;justify-content:space-between;font-size:11px;color:#475569;font-weight:600}
.pdf-opacity-quick{display:flex;gap:4px}
.pdf-opacity-btn{flex:1;padding:3px 0!important;min-height:24px!important;font-size:10px!important;border:1px solid #cbd5e1!important;border-radius:4px!important;background:#fff!important;color:#334155!important;cursor:pointer;font-weight:600}
.pdf-opacity-btn.active{background:#0284c7!important;color:#fff!important;border-color:#0284c7!important}
.pdf-stroke-size-row{display:flex;flex-direction:column;gap:4px;padding-top:2px;border-top:1px dashed #cbd5e1}
.pdf-stroke-size-header{display:flex;justify-content:space-between;font-size:11px;color:#475569;font-weight:600}
.pdf-stroke-size-quick{display:flex;gap:4px}
.pdf-size-btn{flex:1;padding:3px 0!important;min-height:24px!important;font-size:10px!important;border:1px solid #cbd5e1!important;border-radius:4px!important;background:#fff!important;color:#334155!important;cursor:pointer;font-weight:600}
.pdf-size-btn.active{background:#0284c7!important;color:#fff!important;border-color:#0284c7!important}.pdf-dialog{width:94vw;max-width:1500px;height:94dvh;padding:0;border:0;border-radius:12px;background:#f8fafc;color:#182b29}.pdf-dialog::backdrop{background:#0009}.pdf-dialog[open]{display:flex;flex-direction:column}.pdf-dialog header{display:flex;justify-content:space-between;gap:12px;padding:12px}.pdf-dialog header strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pdf-dialog header button{min-height:40px}.pdf-content{flex:1;min-height:0;overflow:auto;overflow-y:auto;overflow-x:auto;-webkit-overflow-scrolling:touch;background:#cbd5e1}.pdf-page canvas{display:block}#viewer-body:has(.pdf-page){display:block;overflow:auto;overflow-y:auto;overflow-x:auto;-webkit-overflow-scrolling:touch;background:#cbd5e1;padding:8px 0;scroll-behavior:smooth}@media(max-width:600px){.pdf-toolbar{gap:4px;padding:4px}.pdf-toolbar button,.pdf-toolbar select{font-size:12px;min-height:42px;padding:5px 7px}.pdf-toolbar+span{font-size:11px}.pdf-dialog{width:100vw;height:100dvh;max-height:100dvh;border-radius:0}}
