.pdf-editor-page {
    max-width: 1740px;
}

.pdf-editor-shell {
    background: #f5f7fb;
    border: 1px solid #d8e2ef;
    border-radius: 8px;
    min-height: calc(100vh - 120px);
    overflow: hidden;
}

.pdf-editor-topbar,
.pdf-editor-ribbon,
.pdf-editor-meta,
.pdf-preview-titlebar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #dde6f2;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.75rem 0.9rem;
}

.pdf-brand-block {
    min-width: 210px;
}

.pdf-editor-kicker {
    color: #5d6b82;
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.fw-black {
    font-weight: 900;
}

.pdf-file-actions,
.pdf-save-actions,
.pdf-status-badges,
.pdf-ribbon-group,
.pdf-tool-grid,
.pdf-zoom-controls,
.pdf-inline-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.pdf-file-actions {
    flex: 1 1 auto;
}

.pdf-save-actions {
    justify-content: flex-end;
}

.pdf-editor-ribbon {
    align-items: stretch;
    background: #fbfcff;
    justify-content: flex-start;
}

.pdf-ribbon-group {
    border-right: 1px solid #e2e8f0;
    padding-right: 0.75rem;
}

.pdf-ribbon-group:last-child {
    border-right: 0;
    margin-left: auto;
    padding-right: 0;
}

.pdf-ribbon-group .btn {
    align-items: center;
    display: inline-flex;
    gap: 0.32rem;
    min-height: 34px;
}

.pdf-tool-grid .btn.is-active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
}

.pdf-editor-meta {
    background: #ffffff;
    padding-bottom: 0.55rem;
    padding-top: 0.55rem;
}

.pdf-editor-meta .alert {
    flex: 1 1 auto;
    min-height: 38px;
    padding: 0.45rem 0.75rem;
}

.pdf-editor-workbench {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 720px;
}

.pdf-pages-panel {
    background: #ffffff;
    border-right: 1px solid #dce5f1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    overflow: auto;
    padding: 0.8rem;
}

.pdf-panel-title {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.pdf-thumbnail-list {
    display: grid;
    gap: 0.55rem;
}

.pdf-thumb {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #d8e3f2;
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    gap: 0.65rem;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    min-height: 82px;
    padding: 0.55rem;
    text-align: left;
    width: 100%;
}

.pdf-thumb:hover,
.pdf-thumb.is-active {
    background: #eef6ff;
    border-color: #5b9bff;
}

.pdf-thumb.is-excluded {
    opacity: 0.52;
}

.pdf-thumb.is-drop-target {
    border-color: #12b886;
    box-shadow: 0 0 0 3px rgba(18, 184, 134, 0.14);
}

.pdf-thumb canvas,
.pdf-thumb-placeholder {
    background: #ffffff;
    border: 1px solid #d8e3f2;
    border-radius: 4px;
    height: 72px;
    object-fit: contain;
    width: 52px;
}

.pdf-thumb-main {
    min-width: 0;
}

.pdf-thumb-main strong,
.pdf-thumb-main span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-thumb-main span {
    color: #667085;
    font-size: 0.78rem;
}

.pdf-thumb-check {
    display: grid;
    gap: 0.35rem;
    justify-items: center;
}

.pdf-split-tool {
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
    padding-top: 0.75rem;
}

.pdf-canvas-panel {
    background: #eef2f7;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
}

.pdf-preview-titlebar {
    color: #334155;
    font-size: 0.88rem;
}

.pdf-preview-titlebar span {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 700;
}

.pdf-drop-zone {
    min-height: 100%;
    overflow: auto;
    padding: 1.15rem;
}

.pdf-drop-zone.is-dragging {
    background: #e8f7f1;
    outline: 2px dashed #12b886;
    outline-offset: -10px;
}

.pdf-empty-state,
.pdf-empty-mini {
    align-items: center;
    color: #667085;
    display: grid;
    gap: 0.35rem;
    justify-items: center;
    min-height: 240px;
    text-align: center;
}

.pdf-empty-state i {
    font-size: 2.6rem;
}

.pdf-empty-state strong {
    color: #101828;
    font-size: 1.1rem;
}

.pdf-empty-mini {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    min-height: 94px;
    padding: 0.75rem;
}

.pdf-page-stage {
    align-items: start;
    display: grid;
    justify-items: center;
    min-height: 100%;
    min-width: max-content;
    padding: 1rem;
}

.pdf-page-board {
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.20);
    line-height: 0;
    position: relative;
}

#pdfCanvas,
.pdf-overlay {
    display: block;
}

.pdf-overlay {
    cursor: crosshair;
    inset: 0;
    position: absolute;
    touch-action: none;
}

.pdf-overlay[data-tool="select"] {
    cursor: default;
}

.pdf-overlay[data-tool="editText"] {
    cursor: text;
}

.pdf-overlay[data-tool="erase"],
.pdf-overlay[data-tool="line"],
.pdf-overlay[data-tool="highlight"],
.pdf-overlay[data-tool="redact"] {
    cursor: crosshair;
}

.pdf-annotation {
    pointer-events: all;
}

.pdf-annotation.is-selected .pdf-select-outline {
    fill: none;
    stroke: #2563eb;
    stroke-dasharray: 5 4;
    stroke-width: 2;
}

.pdf-text-edit-control {
    pointer-events: all;
}

.pdf-text-edit-box {
    cursor: move;
    fill: rgba(37, 99, 235, 0.03);
    stroke: rgba(37, 99, 235, 0.55);
    stroke-dasharray: 5 4;
    stroke-width: 1.4;
}

.pdf-text-edit-control.is-selected .pdf-text-edit-box {
    fill: rgba(37, 99, 235, 0.07);
    stroke: #2563eb;
    stroke-width: 2;
}

.pdf-text-edit-handle {
    fill: #ffffff;
    pointer-events: all;
    stroke: #2563eb;
    stroke-width: 1.8;
}

.pdf-text-edit-handle-west,
.pdf-text-edit-handle-east {
    cursor: ew-resize;
}

.pdf-text-edit-handle-south-east {
    cursor: nwse-resize;
}

.pdf-text-hit {
    cursor: text;
    fill: transparent;
    pointer-events: all;
    stroke: transparent;
    stroke-width: 1;
}

.pdf-text-hit:hover {
    fill: rgba(13, 110, 253, 0.10);
    stroke: rgba(13, 110, 253, 0.55);
}

.pdf-inline-editor {
    background: #ffffff;
    border: 2px solid #0d6efd;
    border-radius: 6px;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.25);
    display: grid;
    gap: 0.4rem;
    line-height: 1.2;
    min-width: 180px;
    padding: 0.35rem;
    position: absolute;
    z-index: 30;
}

.pdf-inline-editor textarea {
    border: 0;
    box-shadow: none;
    font-family: Arial, sans-serif;
    line-height: 1.25;
    min-height: 42px;
    outline: 0;
    padding: 0.2rem;
    resize: both;
}

.pdf-inline-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.pdf-floating-panel {
    align-items: end;
    background: #ffffff;
    border-top: 1px solid #dce5f1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.7rem 0.9rem;
}

.pdf-floating-panel textarea {
    min-width: min(360px, 100%);
}

.pdf-floating-panel label,
.pdf-inline-controls label {
    color: #526071;
    font-size: 0.76rem;
    font-weight: 800;
}

.pdf-bottom-tools {
    background: #ffffff;
    border-top: 1px solid #dce5f1;
    display: grid;
    gap: 0.45rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 0.7rem 0.9rem;
}

.pdf-bottom-tools details {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
}

.pdf-bottom-tools summary {
    cursor: pointer;
    font-weight: 800;
}

.pdf-inline-controls {
    align-items: end;
}

.pdf-inline-controls label {
    flex: 1 1 88px;
    min-width: 0;
}

.pdf-inline-controls textarea {
    flex: 2 1 220px;
}

.pdf-signature-row {
    align-items: start;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(180px, 1fr) auto;
}

.pdf-signature-pad {
    background: #ffffff;
    border: 1px dashed #9aa8bc;
    border-radius: 8px;
    display: block;
    height: 94px;
    touch-action: none;
    width: 100%;
}

@media (max-width: 1200px) {
    .pdf-editor-topbar,
    .pdf-editor-ribbon,
    .pdf-editor-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .pdf-ribbon-group:last-child {
        margin-left: 0;
    }

    .pdf-editor-workbench {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .pdf-bottom-tools {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .pdf-editor-workbench {
        grid-template-columns: 1fr;
    }

    .pdf-pages-panel {
        border-bottom: 1px solid #dce5f1;
        border-right: 0;
        max-height: 280px;
    }

    .pdf-thumbnail-list {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    }

    .pdf-file-actions,
    .pdf-save-actions,
    .pdf-ribbon-group,
    .pdf-status-badges {
        width: 100%;
    }

    .pdf-file-actions .btn,
    .pdf-save-actions .btn {
        flex: 1 1 130px;
    }

    .pdf-signature-row {
        grid-template-columns: 1fr;
    }
}
