.preferences-page__title {
    color: #0f172a;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.preferences-page__subtitle {
    color: #64748b;
    font-size: 0.95rem;
}

.preferences-tabs {
    border-bottom: 1px solid #e2e8f0;
    gap: 0.25rem;
    margin-bottom: 1rem;
    margin-top: .75rem;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.preferences-tabs .nav-link {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: #64748b;
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.7rem 0.9rem;
    white-space: nowrap;
}

.preferences-tabs .nav-link:hover {
    color: var(--primary);
}

.preferences-tabs .nav-link.active {
    background: transparent;
    border-bottom-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.preferences-section__header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.preferences-section__title {
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.preferences-btn-primary {
    background: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 0.45rem;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
}

.preferences-btn-primary:hover,
.preferences-btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

.preferences-btn-outline {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.45rem;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
}

.preferences-btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.preferences-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    overflow: hidden;
}

.preferences-table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.preferences-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.75rem 1rem;
    text-transform: uppercase;
}

.preferences-table tbody td {
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.9rem;
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

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

.preferences-table__drag-col {
    width: 2.5rem;
    padding-left: 0.75rem !important;
    padding-right: 0.25rem !important;
}

.preferences-drag {
    color: #94a3b8;
    cursor: grab;
    display: inline-flex;
}

.preferences-stage-row.is-dragging {
    opacity: 0.55;
}

.preferences-stage-row.drag-over {
    background: var(--primary-lighter);
}

.preferences-badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.35rem 0.65rem;
}

.preferences-badge--inhouse {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.preferences-badge--sub {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.preferences-badge--locked {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.preferences-usage--locked {
    color: #64748b;
    font-weight: 500;
}

.preferences-actions {
    display: inline-flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

.preferences-btn-action {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.4rem;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.3rem 0.7rem;
}

.preferences-btn-action:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.preferences-btn-locked {
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.4rem;
    color: #64748b;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 500;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
}

.preferences-empty {
    color: #64748b;
    font-size: 0.9rem;
    padding: 1.5rem 1rem;
    text-align: center;
}

.preferences-empty--bordered {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 0.65rem;
}

.preferences-placeholder {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    color: #64748b;
    padding: 2rem 1.25rem;
    text-align: center;
}

.preferences-stage-orders {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.preferences-order-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    overflow: hidden;
}

.preferences-order-card__header {
    align-items: center;
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.9rem 1rem;
}

.preferences-order-card__title-wrap {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    min-width: 0;
}

.preferences-order-card__title {
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 700;
}

.preferences-order-title-input {
    font-weight: 600;
    max-width: 260px;
    min-width: 180px;
}

.preferences-order-card__meta {
    align-items: center;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.85rem;
    gap: 0.85rem;
}

.preferences-icon-btn {
    align-items: center;
    background: transparent;
    border: 0;
    color: #64748b;
    display: inline-flex;
    padding: 0.2rem;
}

.preferences-icon-btn:hover {
    color: #0f172a;
}

.preferences-chevron {
    transition: transform 0.18s ease;
}

.preferences-chevron.is-open {
    transform: rotate(180deg);
}

.preferences-order-card__body {
    border-top: 1px solid #e2e8f0;
}

.preferences-table--order thead th {
    background: #fff;
}

.preferences-seq-col {
    width: 7rem;
}

.preferences-seq-input {
    max-width: 4.5rem;
}

.preferences-remove-btn {
    background: transparent;
    border: 0;
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.2rem 0.4rem;
}

.preferences-remove-btn:hover {
    color: #b91c1c;
    text-decoration: underline;
}

.preferences-order-card__footer {
    align-items: center;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
}

@media (max-width: 767.98px) {
    .preferences-section__header {
        align-items: stretch;
        flex-direction: column;
        gap: 0.65rem;
    }

    .preferences-order-card__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .preferences-order-title-input {
        max-width: 100%;
        width: 100%;
    }
}

/* ---------- Design Attributes ---------- */
.design-attr-panel__header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.design-attr-panel__title {
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.design-attr-panel__card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    overflow: hidden;
}

.design-attr-panel__table-head {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
    display: grid;
    font-size: 0.72rem;
    font-weight: 600;
    grid-template-columns: 1fr auto;
    letter-spacing: 0.04em;
    padding: 0.7rem 1rem;
    text-transform: uppercase;
}

.design-attr-panel__list {
    max-height: 280px;
    overflow-y: auto;
}

.design-attr-panel__row {
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.design-attr-panel__row:last-child {
    border-bottom: 0;
}

.design-attr-panel__name {
    color: #1e293b;
    font-size: 0.92rem;
    font-weight: 500;
}

.design-attr-panel__actions {
    display: inline-flex;
    gap: 0.4rem;
}

.design-attr-panel__empty {
    font-size: 0.88rem;
    padding: 1rem;
    text-align: center;
}

.design-attr-panel__form {
    border-top: 1px solid #e2e8f0;
    padding: 0.85rem 1rem;
}

.design-attr-panel__form-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.design-attr-panel__form-row .form-control {
    flex: 1 1 160px;
    min-width: 140px;
}

.design-attr-panel__form .invalid-feedback {
    margin-top: 0.4rem;
}

/* ---------- Product Layers ---------- */
.product-layers__intro {
    margin-bottom: 1rem;
}

.product-layers__title {
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.product-layers__subtitle {
    color: #555555;
    font-size: 1rem;
    max-width: 900px;
}

.product-layers__card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    overflow: hidden;
}

.product-layers-table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.product-layers-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.7rem 1rem;
    text-transform: uppercase;
}

.product-layers-table tbody td,
.product-layers-table tfoot td {
    border-bottom: 1px solid #f1f5f9;
    padding: 0.7rem 1rem;
    vertical-align: middle;
}

.product-layers-table tbody tr:last-child td {
    border-bottom: 1px solid #f1f5f9;
}

.product-layers-name-cell {
    align-items: center;
    display: flex;
    gap: 0.6rem;
    max-width: 320px;
}

.product-layers-name-cell .form-control {
    max-width: 240px;
}

.product-layers-dot {
    border-radius: 50%;
    flex-shrink: 0;
    height: 0.6rem;
    width: 0.6rem;
}

.product-layers-yard-cell {
    align-items: center;
    display: flex;
    gap: 0.65rem;
}

.product-layers-yard-cell .form-control {
    max-width: 220px;
}

.product-layers-yard-cell__hint {
    color: #94a3b8;
    font-size: 0.82rem;
    white-space: nowrap;
}

.product-layers-add-row .form-control::placeholder {
    color: #cbd5e1;
}

.product-layers__empty {
    font-size: 0.88rem;
    padding: 1rem;
    text-align: center;
}

/* ---------- Units settings ---------- */
.units-settings__title {
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.units-settings__subtitle {
    color: #555555;
    font-size: 1rem;
}

.units-settings__card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    overflow: hidden;
}

.units-settings__head {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
    display: grid;
    font-size: 0.72rem;
    font-weight: 600;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 280px);
    gap: 1rem;
    letter-spacing: 0.04em;
    padding: 0.75rem 1.1rem;
    text-transform: uppercase;
}

.units-settings__body {
    display: flex;
    flex-direction: column;
}

.units-settings__row {
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 280px);
    padding: 0.85rem 1.1rem;
}

.units-settings__row:last-child {
    border-bottom: 0;
}

.units-settings__stage-name {
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 500;
}

.units-settings__unit-select .form-select {
    border-color: #d1d5db;
    border-radius: 0.45rem;
    font-size: 0.9rem;
    max-width: 220px;
}

.units-settings__empty {
    color: #64748b;
    font-size: 0.9rem;
    padding: 1.5rem 1rem;
    text-align: center;
}

@media (max-width: 575.98px) {
    .units-settings__head,
    .units-settings__row {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .units-settings__head span:last-child {
        display: none;
    }

    .units-settings__unit-select .form-select {
        max-width: 100%;
    }
}

/* ---------- Suppliers settings ---------- */
.suppliers-settings__header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.suppliers-settings__title {
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.suppliers-settings__card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    overflow: hidden;
}

.suppliers-table td {
    vertical-align: middle;
}

.suppliers-status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.35rem 0.65rem;
}

.suppliers-status--active {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.suppliers-status--inactive {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

@media (max-width: 767.98px) {
    .suppliers-settings__header {
        align-items: stretch;
        flex-direction: column;
        gap: 0.65rem;
    }
}

/* ---------- Company settings ---------- */
.company-settings__title {
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.company-settings__form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    max-width: 760px;
    padding: 1.25rem 1.35rem;
}

.company-settings__row {
    align-items: center;
    display: grid;
    gap: 1rem;
    grid-template-columns: 160px minmax(0, 1fr);
    margin-bottom: 1rem;
}

.company-settings__row--top {
    align-items: flex-start;
}

.company-settings__label {
    color: #334155;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0;
    padding-top: 0.4rem;
}

.company-settings__field .form-control {
    border-color: #d1d5db;
    border-radius: 0.45rem;
    font-size: 0.92rem;
    max-width: 420px;
}

.company-settings__field textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

.company-settings__actions {
    margin-top: 0.5rem;
    padding-left: calc(160px + 1rem);
}

@media (max-width: 767.98px) {
    .company-settings__row,
    .company-settings__row--top {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .company-settings__label {
        padding-top: 0;
    }

    .company-settings__field .form-control {
        max-width: 100%;
    }

    .company-settings__actions {
        padding-left: 0;
    }
}
