:root {
    font-family: Arial, Helvetica, sans-serif;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f6f8;
    color: #1f2937;
}

a {
    color: #1d4ed8;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 24px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}

.top-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.env {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.card {
    display: block;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
}

.card:hover {
    border-color: #94a3b8;
}

.muted {
    color: #64748b;
}

.auth-page {
    min-height: 70vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.auth-card {
    width: min(100%, 460px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 28px;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.auth-header h1 {
    margin: 0 0 6px;
}

.auth-header p {
    margin: 0;
    color: #64748b;
}

.form {
    display: grid;
    gap: 16px;
}

.form label {
    display: grid;
    gap: 7px;
    font-weight: 600;
}

.form input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
}

.button {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    background: #1f2937;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.button-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.alert {
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 18px;
    background: #fff;
}

.alert-error {
    border-color: #fca5a5;
    background: #fef2f2;
}

.alert-success {
    border-color: #86efac;
    background: #f0fdf4;
}

@media (max-width: 640px) {
    .topbar,
    .auth-header {
        flex-direction: column;
    }

    .page {
        padding: 28px 16px;
    }
}


.form-page {
    max-width: 760px;
}

.form-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
}

.form select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    font: inherit;
}

.check-row {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.check-row input {
    width: 18px;
    min-height: auto;
    height: 18px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.table th,
.table td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.table th {
    background: #f8fafc;
    font-size: 13px;
}

.table tr:last-child td {
    border-bottom: 0;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.permissions-table th:not(:first-child),
.permissions-table td:not(:first-child) {
    text-align: center;
}

.permissions-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.form-actions {
    margin-top: 18px;
}


.auth-help {
    margin: 0;
    text-align: center;
    font-size: 14px;
}

.activation-box {
    display: grid;
    gap: 8px;
    padding: 20px;
    margin: 18px 0;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
}

.activation-box span {
    color: #64748b;
    font-size: 14px;
}

.activation-box strong {
    font-size: 30px;
    letter-spacing: 0.08em;
}


.form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    font: inherit;
    resize: vertical;
}

.button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.button-secondary {
    background: #475569;
}

.button-danger {
    background: #991b1b;
}

.maintenance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    align-items: start;
}

.maintenance-grid h2,
.section-block h2 {
    margin-top: 0;
}

.maintenance-danger {
    border-color: #fecaca;
}

.stack-actions {
    display: grid;
    gap: 12px;
}

.stack-actions form,
.stack-actions .button {
    width: 100%;
}

.stack-actions .button {
    justify-content: center;
}

.notice {
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.status-badge {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.section-block {
    margin-top: 28px;
}


.field-help {
    display: block;
    margin-top: -2px;
    color: #64748b;
    font-size: 12px;
    font-weight: 400;
}

/* Versão 7 - Compras (QA) */
.purchases-page {
    max-width: 1380px;
}

.purchase-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
    border-bottom: 1px solid #e2e8f0;
}

.purchase-tabs a {
    padding: 12px 16px;
    color: #475569;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 3px solid transparent;
}

.purchase-tabs a.active {
    color: #0f172a;
    border-bottom-color: #0f172a;
}

.integration-status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-heading h2,
.section-heading p {
    margin-top: 0;
}

.request-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.request-meta > div {
    display: grid;
    gap: 5px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.request-meta span {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.purchase-items {
    display: grid;
    gap: 18px;
}

.purchase-item-card {
    padding: 20px;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    background: #fff;
}

.purchase-item-header,
.field-row-heading,
.purchase-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.purchase-item-header {
    margin-bottom: 16px;
}

.link-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: #b91c1c;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.purchase-fields {
    display: grid;
    grid-template-columns: minmax(240px, .8fr) minmax(360px, 1.8fr);
    gap: 14px;
}

.purchase-fields label,
.single-quantity-block label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.purchase-fields input,
.purchase-fields textarea,
.single-quantity-block input,
.cr-filter,
.smart-filter-input,
.size-quantity-row input {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font: inherit;
}

.wide-field textarea {
    min-height: 90px;
    resize: vertical;
}

.size-mode-row,
.single-quantity-block,
.sizes-block,
.cr-block {
    margin-top: 18px;
}

.toggle-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.toggle-field input {
    width: 18px;
    height: 18px;
}

.field-label {
    margin: 0 0 8px;
    font-weight: 700;
}

.size-chips,
.cr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.size-chip,
.cr-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.size-chip.active,
.cr-chip input:checked + span {
    border-color: #0f172a;
    background: #0f172a;
    color: #fff;
}

.cr-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.selected-sizes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 180px));
    gap: 10px;
    margin-top: 12px;
}

.size-quantity-row {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.size-quantity-row input {
    min-width: 0;
}

.cr-filter,
.smart-filter-input {
    max-width: 320px;
}

.selection-order {
    margin-top: 9px;
    min-height: 20px;
}

.purchase-submit-row {
    margin-top: 20px;
}

.requests-table td:first-child {
    white-space: nowrap;
}

@media (max-width: 760px) {
    .section-heading,
    .field-row-heading,
    .purchase-submit-row {
        align-items: stretch;
        flex-direction: column;
    }

    .request-meta,
    .purchase-fields {
        grid-template-columns: 1fr;
    }

    .cr-filter,
    .smart-filter-input {
        max-width: none;
    }
}

/* V7 - fluxo de item -> carrinho */
.purchase-item-editor {
    margin-bottom: 22px;
}

.purchase-item-hint {
    margin: 4px 0 0;
}

.item-editor-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.item-validation-message {
    flex: 1;
    min-height: 20px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

.item-validation-message.error {
    color: #b91c1c;
}

.purchase-item-editor [aria-invalid="true"] {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, .08);
}

.purchase-cart-section {
    margin-top: 22px;
    padding: 20px;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    background: #f8fafc;
}

.purchase-cart-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.purchase-cart-heading h3,
.purchase-cart-heading p {
    margin-top: 0;
}

.purchase-cart-heading h3 {
    margin-bottom: 4px;
}

.purchase-cart-heading p {
    margin-bottom: 0;
}

.cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.purchase-cart-list {
    display: grid;
    gap: 10px;
}

.purchase-cart-empty {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #64748b;
    text-align: center;
}

.purchase-cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.purchase-cart-item-main {
    min-width: 0;
    flex: 1;
}

.purchase-cart-item-title {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.purchase-cart-item-title strong {
    display: block;
    margin-bottom: 3px;
}

.purchase-cart-item-title p {
    margin: 0;
    color: #64748b;
    line-height: 1.4;
}

.cart-item-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.purchase-cart-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 9px 0 0 39px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

.purchase-cart-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.purchase-cart-item-actions .edit-cart-item {
    color: #1d4ed8;
}

@media (max-width: 760px) {
    .item-editor-footer,
    .purchase-cart-heading,
    .purchase-cart-item {
        align-items: stretch;
        flex-direction: column;
    }

    .item-editor-footer .button {
        width: 100%;
    }

    .purchase-cart-item-actions {
        justify-content: flex-end;
    }
}

/* V7 - alinhamento do bloco de CRs */
.cr-block {
    margin-top: 24px;
}

.cr-section-heading {
    align-items: center;
    margin-bottom: 12px;
}

.cr-section-heading .field-label {
    margin: 0;
}

.cr-section-heading .cr-filter {
    flex: 0 1 320px;
    width: 320px;
    max-width: 100%;
    min-height: 40px;
}

.cr-chips {
    align-items: center;
    gap: 8px;
    margin: 0;
}

.cr-chip {
    position: relative;
    display: inline-flex;
}

.cr-chip[data-order]::after {
    content: attr(data-order);
    position: absolute;
    top: -6px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #257A98;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

@media (max-width: 760px) {
    .cr-section-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .cr-section-heading .cr-filter {
        width: 100%;
        flex-basis: auto;
    }
}

/* V7 - detalhe de solicitação em modal */
html.has-request-modal {
    overflow: hidden;
}

.request-summary-row {
    cursor: pointer;
}

.request-modal {
    width: min(1040px, calc(100vw - 48px));
    max-width: 1040px;
    max-height: 86vh;
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #fff;
    color: #002034;
    box-shadow: 0 24px 70px rgba(0, 32, 52, .22);
    overflow: hidden;
}

.request-modal::backdrop {
    background: rgba(0, 32, 52, .42);
    backdrop-filter: blur(2px);
}

.request-modal-shell {
    display: flex;
    flex-direction: column;
    max-height: 86vh;
}

.request-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e7ea;
    background: #fff;
}

.request-modal-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.request-modal-title h3 {
    margin: 0;
    color: #002034;
    font-size: 18px;
    font-weight: 700;
}

.request-modal-title span {
    color: #66747b;
    font-size: 13px;
    font-weight: 500;
}

.request-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.request-modal-header .request-modal-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #d8dee1;
    border-radius: 8px;
    background: #fff;
    color: #516266;
    cursor: pointer;
}

.request-modal-header .request-modal-close:hover {
    border-color: #257a98;
    color: #257a98;
}

.request-modal-header .request-modal-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.request-modal-meta {
    display: grid;
    grid-template-columns: minmax(160px, .85fr) minmax(220px, 1.15fr) minmax(180px, 1fr);
    gap: 0;
    padding: 0 22px;
    border-bottom: 1px solid #e2e7ea;
    background: #f8fafb;
}

.request-modal-meta > div {
    min-width: 0;
    padding: 14px 18px 14px 0;
}

.request-modal-meta > div + div {
    padding-left: 18px;
    border-left: 1px solid #e2e7ea;
}

.request-modal-meta span {
    display: block;
    margin-bottom: 4px;
    color: #66747b;
    font-size: 12px;
    font-weight: 600;
}

.request-modal-meta strong:not(.status-badge) {
    display: block;
    overflow: hidden;
    color: #172329;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-modal-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 18px 22px;
    background: #fff;
}

.request-modal-table {
    margin: 0;
    table-layout: auto;
}

.request-modal-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f3f5f6;
    white-space: nowrap;
}

.request-modal-table th,
.request-modal-table td {
    vertical-align: middle;
}

.request-modal-table th:first-child,
.request-modal-table td:first-child {
    min-width: 150px;
}

.request-modal-table th:nth-child(2),
.request-modal-table td:nth-child(2) {
    min-width: 260px;
}

.request-number-column,
.request-cr-column {
    text-align: right;
    white-space: nowrap;
}

.request-modal-documents {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid #e2e7ea;
    background: #fff;
}

.request-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid #e2e7ea;
    background: #f8fafb;
}

@media (max-width: 760px) {
    .request-modal {
        width: calc(100vw - 16px);
        max-width: none;
        max-height: calc(100vh - 16px);
        border-radius: 10px;
    }

    .request-modal-shell {
        max-height: calc(100vh - 16px);
    }

    .request-modal-header,
    .request-modal-table-wrap,
    .request-modal-documents,
    .request-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .request-modal-meta {
        grid-template-columns: 1fr;
        padding: 0 16px;
    }

    .request-modal-meta > div,
    .request-modal-meta > div + div {
        padding: 10px 0;
        border-left: 0;
    }

    .request-modal-meta > div + div {
        border-top: 1px solid #e2e7ea;
    }

    .request-modal-footer {
        flex-wrap: wrap;
    }
}

/* V7 - carrinho em tabela com edição inline */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.purchase-cart-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e7ea;
    border-radius: 10px;
    background: #fff;
}

.purchase-cart-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    background: #fff;
}

.purchase-cart-table[hidden] {
    display: none;
}

.purchase-cart-table th,
.purchase-cart-table td {
    padding: 12px 14px;
    vertical-align: middle;
    border-bottom: 1px solid #edf0f2;
}

.purchase-cart-table thead th {
    background: #f3f5f6;
    color: #516266;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.purchase-cart-table tbody tr:last-child td {
    border-bottom: 0;
}

.purchase-cart-table tbody tr:hover:not(.is-editing) {
    background: #f8fafb;
}

.purchase-cart-table .purchase-cart-index {
    width: 48px;
    text-align: center;
    font-weight: 700;
    color: #516266;
}

.purchase-cart-table .purchase-cart-number {
    text-align: right;
    white-space: nowrap;
}

.purchase-cart-table .purchase-cart-actions {
    width: 92px;
    text-align: right;
}

.purchase-cart-action-group {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.icon-action-button {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8dee1;
    border-radius: 8px;
    background: #fff;
    color: #257a98;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.icon-action-button:hover {
    border-color: #257a98;
    background: #f0f7f9;
}

.icon-action-button.danger {
    color: #b42318;
}

.icon-action-button.danger:hover {
    border-color: #f1b7b2;
    background: #fff5f4;
}

.purchase-cart-item.is-editing {
    background: #f8fbfc;
}

.cart-inline-input,
.cart-inline-textarea,
.cart-inline-qty {
    width: 100%;
    min-width: 120px;
    margin: 0;
}

.cart-inline-textarea {
    min-width: 220px;
    resize: vertical;
}

.cart-inline-qty {
    min-width: 88px;
    text-align: right;
}

.cart-inline-size-list {
    display: grid;
    gap: 6px;
    min-width: 110px;
}

.cart-inline-size-list label {
    display: grid;
    grid-template-columns: 36px 70px;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
}

.cart-inline-size-list input {
    width: 70px;
    min-height: 34px;
    padding: 6px 8px;
}

.cart-inline-cr-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 180px;
    max-width: 280px;
    max-height: 112px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid transparent;
    border-radius: 8px;
}

.cart-inline-cr-list.has-error {
    border-color: #b42318;
    background: #fff5f4;
}

.cart-inline-cr-list label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 4px 7px;
    border: 1px solid #d8dee1;
    border-radius: 999px;
    background: #fff;
    font-size: 12px;
    white-space: nowrap;
}

.cart-inline-cr-list input {
    margin: 0;
}

.purchase-cart-empty {
    border: 0;
    border-radius: 0;
    padding: 22px;
}

@media (max-width: 760px) {
    .purchase-cart-section {
        padding: 14px;
    }

    .purchase-cart-table {
        min-width: 900px;
    }
}

.cart-inline-cr-list label[data-order] {
    position: relative;
    padding-right: 22px;
    border-color: #9fc8d6;
    background: #f0f7f9;
}

.cart-inline-cr-list label[data-order]::after {
    content: attr(data-order);
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: #257a98;
    font-size: 10px;
    font-weight: 800;
}

/* V7 - carrinho compacto e edição em modal */
.purchase-cart-table {
    table-layout: fixed;
    min-width: 1040px;
}

.purchase-cart-table col,
.purchase-cart-table th,
.purchase-cart-table td {
    box-sizing: border-box;
}

.purchase-cart-table th:nth-child(1),
.purchase-cart-table td:nth-child(1) { width: 54px; }
.purchase-cart-table th:nth-child(2),
.purchase-cart-table td:nth-child(2) { width: 17%; }
.purchase-cart-table th:nth-child(3),
.purchase-cart-table td:nth-child(3) { width: 28%; }
.purchase-cart-table th:nth-child(4),
.purchase-cart-table td:nth-child(4) { width: 12%; }
.purchase-cart-table th:nth-child(5),
.purchase-cart-table td:nth-child(5) { width: 10%; }
.purchase-cart-table th:nth-child(6),
.purchase-cart-table td:nth-child(6) { width: 15%; }
.purchase-cart-table th:nth-child(7),
.purchase-cart-table td:nth-child(7) { width: 72px; }
.purchase-cart-table th:nth-child(8),
.purchase-cart-table td:nth-child(8) { width: 88px; }

.purchase-cart-row {
    background: #fff;
}

.purchase-cart-row:hover {
    background: #f8fafb;
}

.purchase-cart-row td {
    height: 54px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.cart-row-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #002034;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.purchase-cart-item-name,
.purchase-cart-description,
.purchase-cart-cr,
.purchase-cart-size {
    overflow: hidden;
    text-overflow: ellipsis;
}

.purchase-cart-item-name strong {
    display: block;
    overflow: hidden;
    color: #172329;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-cart-description {
    color: #516266;
    font-size: 13px;
    line-height: 1.35;
}

.purchase-cart-description > span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.purchase-cart-cr,
.purchase-cart-size {
    color: #334a53;
    font-size: 13px;
    white-space: nowrap;
}

.attachment-count {
    display: inline-flex;
    min-width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8dee1;
    border-radius: 999px;
    background: #f8fafb;
    color: #516266;
    font-size: 12px;
    font-weight: 700;
}

.icon-action-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.purchase-cart-edit-dialog {
    width: min(1180px, calc(100vw - 48px));
    max-width: 1180px;
}

.purchase-cart-edit-table-wrap {
    padding-top: 20px;
    padding-bottom: 20px;
}

.purchase-cart-edit-table {
    width: 100%;
    min-width: 1040px;
    table-layout: fixed;
}

.purchase-cart-edit-table th:nth-child(1),
.purchase-cart-edit-table td:nth-child(1) { width: 17%; min-width: 0; }
.purchase-cart-edit-table th:nth-child(2),
.purchase-cart-edit-table td:nth-child(2) { width: 25%; min-width: 0; }
.purchase-cart-edit-table th:nth-child(3),
.purchase-cart-edit-table td:nth-child(3) { width: 14%; min-width: 0; }
.purchase-cart-edit-table th:nth-child(4),
.purchase-cart-edit-table td:nth-child(4) { width: 14%; min-width: 0; }
.purchase-cart-edit-table th:nth-child(5),
.purchase-cart-edit-table td:nth-child(5) { width: 23%; min-width: 0; }
.purchase-cart-edit-table th:nth-child(6),
.purchase-cart-edit-table td:nth-child(6) { width: 7%; min-width: 0; }

.purchase-cart-edit-table td {
    vertical-align: top;
    background: #fff;
}

.cart-edit-text,
.cart-edit-description,
.cart-edit-qty,
.cart-edit-size-qty-row input {
    width: 100%;
    min-height: 38px;
    margin: 0;
}

.cart-edit-description {
    min-height: 82px;
    resize: vertical;
}

.cart-edit-qty {
    min-width: 80px;
    text-align: right;
}

.cart-edit-size-choices,
.cart-edit-size-quantities {
    display: grid;
    gap: 6px;
    max-height: 210px;
    overflow-y: auto;
    padding-right: 3px;
}

.cart-edit-size-choice {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    margin: 0;
    padding: 5px 8px;
    border: 1px solid #d8dee1;
    border-radius: 7px;
    background: #fff;
    color: #516266;
    font-size: 12px;
    cursor: pointer;
}

.cart-edit-size-choice.is-active {
    border-color: #9fc8d6;
    background: #f0f7f9;
    color: #0f5f78;
    font-weight: 700;
}

.cart-edit-size-choice input {
    margin: 0;
}

.cart-edit-size-qty-row {
    display: none;
    grid-template-columns: 34px minmax(68px, 1fr);
    align-items: center;
    gap: 6px;
    min-height: 32px;
    margin: 0;
    color: #516266;
    font-size: 12px;
}

.cart-edit-size-qty-row.is-active {
    display: grid;
}

.cart-edit-size-qty-row input {
    min-width: 68px;
    min-height: 32px;
    padding: 5px 7px;
    text-align: right;
}

.cart-edit-cr-list {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
    max-height: 210px;
    overflow-y: auto;
    padding: 3px;
    border: 1px solid transparent;
    border-radius: 8px;
}

.cart-edit-cr-list.has-error {
    border-color: #b42318;
    background: #fff5f4;
}

.cart-edit-cr-list label {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 30px;
    margin: 0;
    padding: 5px 8px;
    border: 1px solid #d8dee1;
    border-radius: 999px;
    background: #fff;
    color: #516266;
    font-size: 11px;
    white-space: nowrap;
    cursor: pointer;
}

.cart-edit-cr-list label[data-order] {
    padding-right: 24px;
    border-color: #9fc8d6;
    background: #f0f7f9;
    color: #0f5f78;
    font-weight: 700;
}

.cart-edit-cr-list label[data-order]::after {
    content: attr(data-order);
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    color: #257a98;
    font-size: 9px;
    font-weight: 800;
}

.cart-edit-cr-list input {
    margin: 0;
}

.purchase-cart-edit-footer .item-validation-message {
    margin-right: auto;
    text-align: left;
}

@media (max-width: 760px) {
    .purchase-cart-edit-dialog {
        width: calc(100vw - 16px);
        max-width: none;
    }

    .purchase-cart-table {
        min-width: 940px;
    }
}
