﻿.qc-page {
    --qc-primary: #1565d8;
    --qc-border: #dde5ef;
    --qc-text: #1d2939;
    --qc-muted: #667085;
    --qc-bg: #f7f9fc;
    padding-bottom: 100px;
    color: var(--qc-text);
}

.qc-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

    .qc-page-header h3 {
        margin: 0;
        font-weight: 750;
    }

    .qc-page-header p {
        margin: 5px 0 0;
        color: var(--qc-muted);
    }

.qc-select-card,
.qc-summary-card,
.qc-category-card,
.qc-empty-card {
    background: #fff;
    border: 1px solid var(--qc-border);
    border-radius: 14px;
    box-shadow: 0 3px 14px rgba(16, 24, 40, 0.05);
}

.qc-select-card {
    padding: 18px;
    margin-bottom: 18px;
}

    .qc-select-card label {
        display: block;
        margin-bottom: 7px;
        font-weight: 650;
    }

.qc-summary-card {
    padding: 18px;
    margin-bottom: 18px;
}

.qc-summary-main {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

    .qc-summary-main > div {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 12px;
        border-radius: 10px;
        background: var(--qc-bg);
    }

.qc-caption {
    font-size: 12px;
    color: var(--qc-muted);
}

.qc-progress-top,
.qc-progress-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.qc-progress {
    height: 10px;
    margin: 8px 0;
    border-radius: 20px;
}

    .qc-progress .progress-bar {
        background: var(--qc-primary);
    }

.qc-progress-info {
    justify-content: flex-start;
    flex-wrap: wrap;
    color: var(--qc-muted);
    font-size: 13px;
}

.qc-category-card {
    margin-bottom: 18px;
    overflow: hidden;
}

.qc-category-header {
    padding: 15px 18px;
    border-bottom: 1px solid var(--qc-border);
    background: #fbfcfe;
}

    .qc-category-header h5 {
        margin: 0;
        font-size: 15px;
        font-weight: 750;
    }

    .qc-category-header span {
        display: inline-block;
        margin-top: 4px;
        font-size: 12px;
        color: var(--qc-muted);
    }

.qc-item-list {
    display: flex;
    flex-direction: column;
}

.qc-item-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #edf1f5;
}

    .qc-item-card:last-child {
        border-bottom: none;
    }

.qc-item-number {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #edf4ff;
    color: var(--qc-primary);
    font-weight: 750;
    font-size: 13px;
}

.qc-item-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

    .qc-item-title-row h6 {
        margin: 5px 0 0;
        font-size: 14px;
        line-height: 1.45;
    }

.qc-history-warning {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
    color: #b54708;
    font-size: 12px;
    font-weight: 650;
}

.qc-status-select {
    min-width: 180px;
    height: 38px;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 650;
    outline: none;
}

    .qc-status-select.is-pending {
        color: #475467;
        border: 1px solid #d0d5dd;
        background: #f9fafb;
    }

    .qc-status-select.is-accepted {
        color: #027a48;
        border: 1px solid #abefc6;
        background: #ecfdf3;
    }

    .qc-status-select.is-repair {
        color: #b42318;
        border: 1px solid #fecdca;
        background: #fef3f2;
    }

.qc-defect-box {
    margin-top: 14px;
    padding: 14px;
    background: #fff8f7;
    border: 1px solid #fecdca;
    border-radius: 10px;
}

    .qc-defect-box label {
        margin-bottom: 6px;
        font-size: 13px;
        font-weight: 700;
    }

.qc-photo-section {
    margin-top: 14px;
}

.qc-photo-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
}

.qc-file-input {
    max-width: 280px;
    font-size: 12px;
}

.qc-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 105px));
    gap: 10px;
}

.qc-photo-box {
    position: relative;
    width: 105px;
    height: 105px;
    overflow: hidden;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    background: #f2f4f7;
}

    .qc-photo-box img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        cursor: pointer;
    }

.qc-photo-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 25px;
    height: 25px;
    border: none;
    border-radius: 50%;
    background: rgba(180, 35, 24, 0.92);
    color: #fff;
    font-size: 17px;
    line-height: 1;
}

.qc-photo-saved,
.qc-photo-after {
    position: absolute;
    bottom: 4px;
    left: 4px;
    padding: 3px 6px;
    border-radius: 5px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.qc-photo-saved {
    background: rgba(2, 122, 72, 0.88);
}

.qc-photo-after {
    background: rgba(21, 101, 216, 0.88);
}

.qc-after-history {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #f1b8b3;
}

    .qc-after-history > span {
        display: block;
        margin-bottom: 8px;
        font-size: 12px;
        color: var(--qc-muted);
        font-weight: 650;
    }

.qc-action-bar {
    position: sticky;
    bottom: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border: 1px solid #d7e3f4;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 30px rgba(16, 24, 40, 0.12);
    backdrop-filter: blur(10px);
}

.qc-autosave-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--qc-muted);
    font-size: 13px;
}

.qc-action-buttons {
    display: flex;
    gap: 10px;
}

.qc-empty-card {
    min-height: 260px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.qc-empty-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border-radius: 50%;
    background: #edf4ff;
    color: var(--qc-primary);
    font-size: 24px;
}

.qc-locked-message {
    padding: 14px;
    border: 1px solid #eaecf0;
    border-radius: 10px;
    color: #475467;
    background: #f9fafb;
    text-align: center;
}

.qc-badge {
    display: inline-flex;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
}

.qc-badge-draft {
    color: #175cd3;
    background: #eff8ff;
}

.qc-badge-repair {
    color: #b54708;
    background: #fffaeb;
}

.qc-badge-ready {
    color: #6941c6;
    background: #f4f3ff;
}

.qc-badge-finish {
    color: #027a48;
    background: #ecfdf3;
}

.qc-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 24px;
    background: rgba(15, 23, 42, 0.78);
    cursor: zoom-out;
}

.qc-preview-image {
    display: block;
    width: auto;
    height: auto;
    max-width: min(700px, 82vw);
    max-height: 78vh;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

.qc-preview-close {
    position: fixed;
    top: 18px;
    right: 22px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 34px;
}

.qc-spinner {
    width: 35px;
    height: 35px;
    margin-bottom: 12px;
    border: 4px solid #dbe8fa;
    border-top-color: var(--qc-primary);
    border-radius: 50%;
    animation: qc-spin 0.8s linear infinite;
}

@keyframes qc-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .qc-summary-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qc-item-title-row {
        flex-direction: column;
    }

    .qc-status-select {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 600px) {
    .qc-page {
        padding-bottom: 150px;
    }

    .qc-summary-main {
        grid-template-columns: 1fr;
    }

    .qc-item-card {
        grid-template-columns: 30px minmax(0, 1fr);
        padding: 14px 12px;
    }

    .qc-photo-label,
    .qc-action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .qc-action-buttons {
        display: grid;
        grid-template-columns: 1fr;
    }

        .qc-action-buttons .btn {
            width: 100%;
        }

    .qc-file-input {
        width: 100%;
        max-width: none;
    }

    .qc-preview-modal {
        padding: 45px 16px;
    }

    .qc-preview-image {
        max-width: 88vw;
        max-height: 72vh;
        border-radius: 10px;
    }
}

.qc-reinspect-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    margin-top: 18px;
    border: 1px solid #b2ccff;
    border-radius: 12px;
    background: #eff8ff;
}

.qc-reinspect-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #d1e9ff;
    color: #175cd3;
    font-size: 20px;
}

.qc-reinspect-content {
    flex: 1;
}

    .qc-reinspect-content h5 {
        margin: 0 0 4px;
        font-weight: 750;
        color: #1849a9;
    }

    .qc-reinspect-content p {
        margin: 0;
        color: #475467;
    }

.qc-finish-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 22px;
    margin-top: 18px;
    border: 1px solid #abefc6;
    border-radius: 12px;
    background: #ecfdf3;
    color: #027a48;
}

    .qc-finish-box i {
        font-size: 28px;
    }

    .qc-finish-box h5 {
        margin: 0 0 3px;
        font-weight: 750;
    }

    .qc-finish-box p {
        margin: 0;
    }

@media (max-width: 700px) {
    .qc-reinspect-box {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .qc-reinspect-icon {
        margin: auto;
    }

    .qc-reinspect-box .btn {
        width: 100%;
    }
}

.qc-finish-result {
    padding: 28px;
    text-align: center;
    border: 1px solid #abefc6;
    border-radius: 14px;
    background: #ecfdf3;
}

.qc-finish-icon {
    margin-bottom: 10px;
    color: #039855;
    font-size: 42px;
}

.qc-finish-result h4 {
    margin-bottom: 5px;
    color: #027a48;
    font-weight: 750;
}

.qc-finish-result p {
    color: #475467;
}

.qc-finish-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
}

    .qc-finish-summary > div {
        padding: 14px;
        border: 1px solid #d0d5dd;
        border-radius: 10px;
        background: #fff;
    }

    .qc-finish-summary span,
    .qc-finish-summary strong {
        display: block;
    }

    .qc-finish-summary span {
        margin-bottom: 5px;
        color: #667085;
        font-size: 12px;
    }

    .qc-finish-summary strong {
        font-size: 22px;
    }

.qc-history-panel {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #fff;
}

.qc-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

    .qc-history-header h5 {
        margin: 0;
        font-weight: 750;
    }

.qc-history-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.qc-history-item {
    position: relative;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
}

    .qc-history-item:not(:last-child)::after {
        position: absolute;
        top: 36px;
        bottom: -14px;
        left: 17px;
        width: 2px;
        background: #d0d5dd;
        content: "";
    }

.qc-history-number {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fdb022;
    color: #fff;
    font-weight: 750;
}

    .qc-history-number.is-finish {
        background: #12b76a;
    }

.qc-history-card {
    padding: 14px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
}

.qc-history-card-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

    .qc-history-card-top span {
        color: #667085;
        font-size: 12px;
    }

.qc-history-counts {
    display: flex;
    gap: 14px;
    margin: 10px 0;
    font-size: 12px;
}

.qc-history-final {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
    padding: 15px;
    border: 1px solid #abefc6;
    border-radius: 10px;
    background: #ecfdf3;
    color: #027a48;
}

@media (max-width: 650px) {
    .qc-finish-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .qc-history-card-top {
        flex-direction: column;
    }
}

.repair-item-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1d2939;
}

.repair-category {
    margin: 4px 0 12px;
    color: #667085;
    font-size: 13px;
}

.qc-note {
    margin: 14px 0 18px;
    padding: 12px 14px;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    background: #fffaf0;
}

.qc-note-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
    color: #b45309;
    font-size: 13px;
    font-weight: 700;
}

.qc-note-body {
    color: #475467;
    line-height: 1.5;
}

.repair-photo-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 14px;
}

.repair-photo-column {
    min-width: 0;
    padding: 14px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    background: #fafbfc;
}

.repair-photo-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

    .repair-photo-title small {
        color: #98a2b3;
        font-size: 11px;
        font-weight: 500;
    }

.preview-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
}

.preview-box {
    width: 110px;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    background: #f2f4f7;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

    .preview-box:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 14px rgba(16, 24, 40, 0.14);
    }

.preview-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.repair-photo-empty {
    display: flex;
    align-items: center;
    min-height: 80px;
    color: #98a2b3;
    font-size: 12px;
}

.repair-work-form {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #eaecf0;
}

.repair-action {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .repair-photo-section {
        grid-template-columns: 1fr;
    }

    .preview-box {
        width: 95px;
    }

    .repair-action .btn {
        width: 100%;
    }
}

.repair-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 15px;
    transition: .2s;
}

    .repair-header:hover {
        background: #f8fafc;
    }

.repair-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .repair-header-left i {
        font-size: 18px;
        color: #2563eb;
        width: 20px;
    }

    .repair-header-left small {
        display: block;
        color: #999;
    }

.repair-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

    .repair-header-right .text-muted {
        font-size: 13px;
        max-width: 300px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }