#pdf-viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.pdf-page {
    display: block;
    margin-bottom: 20px;
    border: 1px solid #e3e3e3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
    max-width: 100%;
    width: auto;
    height: auto;
}

.field-box {
    position: absolute;
    background: rgba(255, 255, 0, 0.35);
    border: 2px solid transparent;
    border-radius: 4px;
    font-size: 12px;
    padding: 2px 4px;
    cursor: move;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    min-height: 30px;
}

.field-box[style*="borderColor"] {
    border-width: 2px !important;
    border-style: solid !important;
}

.field-box.selected {
    border-color: #2d7efc;
    box-shadow: 0 0 4px rgba(0, 123, 255, 0.5);
}

/* Improve cursor accuracy for field boxes */
.field-box {
    cursor: move !important;
}

/* Edge detection areas for resize */
.field-box::before,
.field-box::after {
    pointer-events: none;
}

/* Resize handles */
.field-box::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #2d7efc;
    border: 1px solid #fff;
    border-radius: 50%;
    bottom: -4px;
    right: -4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.field-box.selected::before {
    opacity: 1;
}

.signer-item {
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.signer-item.active {
    border-color: #206bc4;
    background: #e7f1ff;
}

.signer-item-content {
    flex: 1;
    min-width: 0; /* Allow flex item to shrink below content size */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.signer-item-info {
    flex: 1;
    min-width: 0; /* Allow text truncation */
    overflow: hidden;
}

.signer-item-info b,
.signer-item-info small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.signer-item-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.signer-item-actions .btn {
    padding: 2px;
    min-width: 20px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: none;
    background: transparent;
    transition: background 0.15s ease;
}

.signer-item-actions .btn:hover {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
}

.signer-item-actions .btn-icon {
    padding: 0;
    margin: 0;
}

.signer-item-actions .icon {
    width: 14px;
    height: 14px;
    display: block;
    margin: 0;
    flex-shrink: 0;
}

.signer-color-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 6px;
}

.modal {
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
}

.modal.show {
    display: block !important;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.modal-dialog {
    position: relative;
    z-index: 1055;
    margin: 1.75rem auto;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.3rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.5);
}

#json-preview {
    color: #000 !important;
    font-family: 'Courier New', monospace;
    min-height: 100px;
}

/* Workflow Panels Styling */
.workflow-panels {
    position: sticky;
    top: 20px;
}

.workflow-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #206bc4;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.accordion-button {
    font-weight: 500;
}

.accordion-button:not(.collapsed) .workflow-number {
    background: #1a5592;
}

.accordion-icon {
    transition: transform 0.3s ease;
    color: var(--tblr-secondary);
}

.accordion-button:not(.collapsed) .accordion-icon {
    transform: rotate(180deg);
}

.signing-order-dropdown {
    margin-bottom: 0.75rem;
}

.signing-order-dropdown label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    display: block;
}