.hd-pdf-container {
    max-width: 1200px;
    margin: 25px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #2c3338;
}

.pdf-dropzone {
    border: 2px dashed #2271b1;
    background: #f6f7f7;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
}
.pdf-dropzone:hover { background: #f0f6fc; }
.pdf-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.pdf-dropzone .highlight { color: #2271b1; font-weight: 600; }

.pdf-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 12px 18px;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    margin-bottom: 20px;
}
.file-meta strong { margin-right: 10px; font-size: 15px; }
.file-meta span { color: #646970; font-size: 13px; }

.pdf-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}
@media (max-width: 860px) {
    .pdf-layout { grid-template-columns: 1fr; }
}

.pdf-pages-view {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 20px;
    max-height: 720px;
    overflow-y: auto;
}

.pdf-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px;
}

.pdf-page-card {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.pdf-page-card canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background: #fff;
}
.pdf-page-meta {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #50575e;
}
.pdf-page-controls {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.pdf-page-controls button {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    border: 1px solid #ccd0d4;
    background: #fff;
}
.pdf-page-controls button:hover { background: #f0f0f1; }

.sidebar-box {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 20px;
}
.sidebar-box h4 { margin: 0 0 8px 0; font-size: 14px; text-transform: uppercase; color: #1d2327; }
.field-hint { font-size: 12px; color: #646970; margin-bottom: 12px; }
.sidebar-box select {
    width: 100%;
    padding: 7px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    margin-bottom: 8px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.btn {
    border: 1px solid #8c8f94;
    background: #f6f7f7;
    color: #2c3338;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
}
.btn:hover { background: #f0f0f1; }
.btn-n8n { background: #ff6d00; color: #fff; border-color: #e05d00; }
.btn-n8n:hover { background: #e05d00; }
.btn-save-local { background: #2271b1; color: #fff; border-color: #135e96; }
.btn-save-local:hover { background: #135e96; }
.btn-danger { color: #b32d2e; border-color: #b32d2e; }
.btn-danger:hover { background: #b32d2e; color: #fff; }

.pdf-status {
    margin-top: 12px;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    display: none;
}
.status-info { background: #e5f5fa; color: #006080; border: 1px solid #b8e6f5; display: block; }
.status-success { background: #edfaef; color: #135e26; border: 1px solid #c3e6cb; display: block; }
.status-error { background: #fcf0f1; color: #8a2424; border: 1px solid #f5c6cb; display: block; }