/* Set labels page (/images/:id/labels) — scoped under body.page-labels */

.page-labels .labels-page {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 4px 32px;
}

.page-labels .labels-hero {
    background: linear-gradient(180deg, #f4f7fc 0%, #ffffff 52%);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 24px 26px 20px;
    margin-bottom: 22px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 28px rgba(20, 34, 90, 0.08);
}

.page-labels .labels-title {
    margin: 0 0 8px;
    font-size: 28px;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.2;
}

.page-labels .labels-subtitle {
    color: #64748b;
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    max-width: 52ch;
}

/* Panels: compare-table-wrap had no styles here before (only on compare/leaderboard pages). */
.page-labels .compare-table-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px 24px 24px;
    margin-bottom: 20px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 28px rgba(20, 34, 90, 0.09);
}

.page-labels .labels-pages-wrap h3,
.page-labels .labels-import-wrap h3 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.page-labels .labels-pages-desc {
    margin: 0 0 16px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.55;
    color: #475467;
    background: #fff;
    border: 1px solid #e6ecf7;
    border-radius: 10px;
    border-left: 3px solid #1967d2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.page-labels .labels-page-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: stretch;
    margin-bottom: 6px;
}

.page-labels .labels-page-card {
    width: 138px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px;
    background: linear-gradient(180deg, #fafbfd 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.page-labels .labels-page-card img {
    width: 100%;
    height: 104px;
    object-fit: cover;
    border-radius: 10px;
    background: #eef2f890;
}

.page-labels .labels-page-label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    text-align: center;
    letter-spacing: 0.02em;
}

.page-labels .labels-page-delete {
    width: 100%;
    margin-top: 0;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: 8px;
    background: #fff;
    color: #c62828;
    border: 1px solid #fecaca;
}

.page-labels .labels-page-delete:hover {
    background: #fef2f2;
    border-color: #f87171;
}

.page-labels .labels-pages-error {
    margin: 0;
    color: #b42318;
    font-size: 13px;
    font-weight: 500;
}

.page-labels .labels-add-page-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.page-labels .labels-pages-wrap {
    position: relative;
}

.page-labels .labels-add-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 11px 22px;
    margin-top: 8px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(145deg, #1a73e8 0%, #1967d2 45%, #1248a8 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow:
        0 4px 14px rgba(25, 103, 210, 0.35),
        0 1px 0 rgba(255, 255, 255, 0.2) inset;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.page-labels .labels-add-page-btn:hover:not(:disabled) {
    box-shadow:
        0 6px 20px rgba(25, 103, 210, 0.42),
        0 1px 0 rgba(255, 255, 255, 0.2) inset;
    transform: translateY(-1px);
}

.page-labels .labels-add-page-btn:disabled {
    opacity: 0.85;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.08);
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(25, 103, 210, 0.2);
}

.page-labels .labels-add-page-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    font-weight: 300;
}

.page-labels .labels-import-wrap p {
    margin: 0 0 14px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.page-labels .labels-import-wrap code {
    font-size: 12px;
    padding: 2px 6px;
    background: #f1f5f9;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.page-labels .labels-errors-wrap {
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.04);
}

.page-labels .labels-errors-wrap h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.page-labels .labels-errors-wrap p {
    margin: 0 0 10px;
    color: #667085;
    font-size: 13px;
}

.page-labels .error-type-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.page-labels .labels-import-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.page-labels .labels-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.page-labels .labels-toolbar-btn {
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 600;
}

.page-labels .labels-toolbar-btn--import {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.page-labels .labels-toolbar-btn--import:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.page-labels .labels-toolbar-btn--export {
    text-decoration: none;
    background: #fff;
    color: #1967d2;
    border: 2px solid #c3d8fd;
}

.page-labels .labels-toolbar-btn--export:hover {
    background: #e8f0fe;
    border-color: #1967d2;
}

.page-labels .labels-toolbar-btn--add-cat {
    background: #fff;
    color: #1557b0;
    border: 2px solid #1967d2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.page-labels .labels-toolbar-btn--add-cat:hover {
    background: #e8f0fe;
    border-color: #1557b0;
    color: #1248a8;
}

.page-labels #labelSections {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.page-labels .label-section {
    margin-bottom: 0;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 18px 16px;
    background: linear-gradient(180deg, #fafbfd 0%, #ffffff 100%);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.page-labels .label-input-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.page-labels .label-title,
.page-labels .label-lines {
    width: 100%;
    border: 1px solid #cfd8e8;
    border-radius: 11px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
    background: #fafbfd;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.page-labels .label-title::placeholder,
.page-labels .label-lines::placeholder {
    color: #94a3b8;
}

.page-labels .label-title:hover:not(:focus),
.page-labels .label-lines:hover:not(:focus) {
    border-color: #b8c5db;
    background: #fff;
}

.page-labels .label-title:focus,
.page-labels .label-lines:focus {
    border-color: #1967d2;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(25, 103, 210, 0.14);
}

.page-labels .label-lines {
    resize: vertical;
    min-height: 148px;
    line-height: 1.5;
}

.page-labels .label-row-actions {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid #edf1f7;
    display: flex;
    justify-content: flex-end;
}

.page-labels .label-row-actions .btn-compare {
    width: auto;
    margin-top: 0;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    color: #b45309;
    border: 1px solid #fde68a;
    border-radius: 10px;
}

.page-labels .label-row-actions .btn-compare:hover {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.page-labels .labels-sections-head {
    margin: 8px 0 14px;
    padding: 0 2px;
}

.page-labels .labels-sections-head h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
}

.page-labels .labels-sections-head p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.page-labels .labels-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding: 22px 0 0;
    border-top: 1px solid #edf1f7;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.page-labels .labels-save-btn {
    min-height: 48px;
    padding: 13px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(25, 103, 210, 0.32);
}

.page-labels .labels-save-btn:hover:not(:disabled) {
    box-shadow: 0 6px 22px rgba(25, 103, 210, 0.4);
}

.page-labels .labels-save-btn:disabled,
.page-labels .labels-save-btn.is-busy {
    opacity: 0.88;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(25, 103, 210, 0.2);
}

.page-labels .labels-save-btn:disabled:hover,
.page-labels .labels-save-btn.is-busy:hover {
    filter: none;
    transform: none;
    box-shadow: 0 2px 8px rgba(25, 103, 210, 0.2);
}

.page-labels .labels-status {
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 500;
    padding: 12px 14px;
    border-radius: 11px;
    border: 1px solid transparent;
    overflow-wrap: anywhere;
}

.page-labels .labels-status--success {
    color: #217647;
    background: #ecfdf3;
    border-color: #b7ebc6;
    font-weight: 600;
}

.page-labels .labels-status--error {
    color: #b42318;
    background: #fef3f2;
    border-color: #fecdca;
    font-weight: 600;
}

@media (max-width: 640px) {
    .page-labels .labels-page {
        padding-bottom: 28px;
    }

    .page-labels .labels-hero {
        padding: 18px 18px 16px;
    }

    .page-labels .labels-title {
        font-size: 24px;
    }

    .page-labels .compare-table-wrap {
        padding: 18px 16px;
        border-radius: 14px;
    }

    .page-labels .error-type-row {
        grid-template-columns: 1fr;
    }

    .page-labels .label-row-actions .btn-compare,
    .page-labels .labels-import-actions .btn-compare,
    .page-labels .labels-actions .btn-annotate,
    .page-labels .labels-actions .btn-compare {
        width: 100%;
        justify-content: center;
    }

    .page-labels .labels-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
