/* PDF 서명 · 날인 도구 스타일 */

.pdf-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    background-color: var(--surface-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.pdf-file-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.pdf-filename {
    font-weight: 600;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-filesize {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pdf-pager {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.pdf-page-indicator {
    font-size: 0.92rem;
    font-weight: 600;
    min-width: 64px;
    text-align: center;
}

.pdf-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: var(--space-5);
    align-items: start;
}

@media (max-width: 960px) {
    .pdf-layout {
        grid-template-columns: 1fr;
    }
}

.pdf-stage-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--surface-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    overflow: auto;
}

.pdf-stage {
    position: relative;
    display: inline-block;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    background-color: #fff;
    user-select: none;
    touch-action: none;
}

.pdf-canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.overlay-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.sig-item {
    position: absolute;
    cursor: move;
    border: 1.5px dashed transparent;
    border-radius: 4px;
    touch-action: none;
}

.sig-item:hover {
    border-color: var(--accent-ring);
}

.sig-item.is-selected {
    border-color: var(--accent);
    background-color: rgba(59, 130, 246, 0.06);
}

.sig-item img {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    object-fit: contain;
}

.sig-resize-handle {
    position: absolute;
    right: -7px;
    bottom: -7px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--accent);
    border: 2px solid #fff;
    cursor: nwse-resize;
    display: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.sig-item.is-selected .sig-resize-handle {
    display: block;
}

.stage-hint {
    margin: var(--space-3) 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.pdf-sidebar {
    background-color: var(--surface-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
}

.pdf-sidebar .option-chips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.pdf-sidebar .option-chip {
    font-size: 0.85rem;
    padding: 7px 8px;
    text-align: center;
}

.tool-tab-panel {
    margin-top: var(--space-3);
}

.sig-pad-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: #ffffff;
    overflow: hidden;
    margin-bottom: var(--space-3);
}

#sig-pad {
    display: block;
    width: 100%;
    height: 140px;
    cursor: crosshair;
    touch-action: none;
}

.compact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.color-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease;
}

.color-dot.is-active {
    border-color: var(--accent);
    transform: scale(1.15);
    box-shadow: 0 0 0 2px var(--surface);
}

.field-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.field-inline label {
    font-size: 0.85rem;
    margin: 0;
    white-space: nowrap;
}

.field-inline input[type="range"] {
    width: 100%;
}

.compact-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
    margin-top: var(--space-2);
}

.stamp-preview-box {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-3);
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: var(--space-3);
}

.selected-controls {
    margin-top: var(--space-4);
}

.selected-controls hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin-bottom: var(--space-3);
}

.save-box {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

.placed-summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
    text-align: center;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.btn-danger:hover {
    background-color: #bb2d3b;
}

.mt-2 {
    margin-top: var(--space-2);
}
