.organize-page {
    padding: 54px 0 90px;
}

.organize-title {
    max-width: 780px;
    margin-bottom: 32px;
}

.organize-title h1 {
    margin: 0;
    font-size: 42px;
    line-height: 1.15;
    letter-spacing: -1.5px;
}

.organize-title p {
    margin: 16px 0 0;

    color: #6c7178;

    font-size: 16px;
    line-height: 1.75;
}


/* Upload */

.upload-area {
    min-height: 410px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 45px 25px;

    background: #fff;

    border: 2px dashed #d4d8de;
    border-radius: 22px;

    text-align: center;
}

.upload-area.drag-over {
    border-color: #202124;
    background: #f4f5f7;
}

.upload-icon {
    width: 76px;
    height: 76px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 20px;

    border-radius: 22px;

    background: #f1f3f4;

    font-size: 36px;
}

.upload-area h2 {
    margin: 0;
    font-size: 23px;
}

.upload-area p {
    margin: 11px 0 24px;
    color: #777c84;
    font-size: 14px;
}

.primary-btn,
.secondary-btn,
.organize-btn,
.page-action {
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.primary-btn {
    padding: 13px 24px;

    border: 0;
    border-radius: 11px;

    background: #202124;
    color: #fff;

    font-size: 15px;
}

.secondary-btn {
    padding: 10px 15px;

    border: 1px solid #d8dce1;
    border-radius: 9px;

    background: #fff;
    color: #34373b;
}


/* Workspace */

.workspace {
    overflow: hidden;

    background: #fff;

    border: 1px solid #e2e5e9;
    border-radius: 20px;
}

.workspace-toolbar {
    min-height: 70px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 18px 22px;

    border-bottom: 1px solid #e7e9ec;
}

.workspace-toolbar strong {
    display: block;
    margin-bottom: 5px;
}

.workspace-toolbar span {
    color: #858a91;
    font-size: 13px;
}

.workspace-body {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        320px;

    min-height: 650px;
}


/* Pages */

.preview-panel {
    min-width: 0;

    padding: 22px;

    background: #f5f6f8;

    overflow-y: auto;
}

.page-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(150px, 1fr)
        );

    gap: 14px;
}

.page-card {
    position: relative;

    min-width: 0;

    padding: 9px;

    background: #fff;

    border: 1px solid #dfe2e6;
    border-radius: 11px;

    cursor: grab;

    user-select: none;

    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease;
}

.page-card:active {
    cursor: grabbing;
}

.page-card:hover {
    transform: translateY(-1px);

    box-shadow:
        0 5px 15px
        rgba(0, 0, 0, 0.07);
}

.page-card.sortable-ghost {
    opacity: 0.25;
}

.page-card.sortable-chosen {
    box-shadow:
        0 12px 30px
        rgba(0, 0, 0, 0.16);
}

.page-card canvas {
    width: 100%;
    height: auto;

    display: block;

    background: #fff;

    border: 1px solid #eceef1;
    border-radius: 5px;

    transition: transform 0.18s ease;
}

.page-meta {
    margin-top: 8px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;
}

.page-source {
    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;

    color: #555a60;

    font-size: 11px;
    font-weight: 700;
}

.page-actions {
    display: flex;

    gap: 5px;
}

.page-action {
    width: 29px;
    height: 29px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #d9dde1;
    border-radius: 7px;

    background: #fff;

    color: #555a60;

    font-size: 14px;
}

.page-action:hover {
    background: #f1f3f4;
}

.page-action.delete {
    color: #b3261e;
}


/* Source panel */

.source-panel {
    padding: 24px;

    border-left: 1px solid #e2e5e9;

    background: #fff;
}

.source-panel h2 {
    margin: 0 0 8px;

    font-size: 20px;
}

.source-note {
    margin: 0 0 20px;

    color: #777c83;

    font-size: 13px;
    line-height: 1.6;
}

.source-list {
    display: flex;
    flex-direction: column;

    gap: 9px;
}

.source-item {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    padding: 10px;

    border: 1px solid #e3e6e9;
    border-radius: 9px;

    background: #fafafa;
}

.source-label {
    flex: 0 0 30px;

    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background: #202124;
    color: #fff;

    font-size: 12px;
    font-weight: 800;
}

.source-info {
    min-width: 0;

    flex: 1;
}

.source-name {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;

    color: #3d4146;

    font-size: 12px;
    font-weight: 700;
}

.source-pages {
    margin-top: 3px;

    color: #8b9096;

    font-size: 11px;
}


/* Stats */

.stats-box {
    margin-top: 22px;

    overflow: hidden;

    border: 1px solid #e2e5e9;
    border-radius: 10px;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 11px 13px;

    border-bottom: 1px solid #eceef1;

    color: #686d73;

    font-size: 12px;
}

.stat-row:last-child {
    border-bottom: 0;
}

.stat-row strong {
    color: #282c31;

    font-size: 14px;
}


/* Action */

.organize-btn {
    width: 100%;

    margin-top: 22px;
    padding: 13px 20px;

    border: 0;
    border-radius: 11px;

    background: #202124;
    color: #fff;

    font-size: 15px;
}

.organize-btn:hover:not(:disabled) {
    background: #000;
}

.organize-btn:disabled {
    cursor: not-allowed;

    background: #c6c9cd;
}

.error-box {
    margin-top: 18px;

    padding: 11px 12px;

    border: 1px solid #f0c2be;
    border-radius: 9px;

    background: #fff0ef;
    color: #a9251d;

    font-size: 12px;
}

.message-box {
    margin-top: 18px;

    padding: 14px 17px;

    border-radius: 11px;

    font-size: 14px;
}

.message-box.error {
    border: 1px solid #f0c2be;

    background: #fff0ef;
    color: #a9251d;
}

.message-box.success {
    border: 1px solid #c9e6cf;

    background: #eef8f0;
    color: #246b31;
}

.hidden {
    display: none !important;
}


@media (max-width: 850px) {

    .workspace-body {
        grid-template-columns: 1fr;
    }

    .source-panel {
        border-top: 1px solid #e2e5e9;
        border-left: 0;
    }

}


@media (max-width: 600px) {

    .organize-title h1 {
        font-size: 34px;
    }

    .page-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

}
