.bp-order-detail {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex-direction: column;
    gap: 1.25rem;
    color: rgb(31 41 55);
    overflow-x: hidden;
}

.bp-order-detail [x-cloak] {
    display: none !important;
}

.bp-order-section {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.75rem;
    background: rgb(255 255 255);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.025);
}

.bp-order-section__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgb(226 232 240);
    padding-bottom: 0.75rem;
}

.bp-order-section__title {
    margin: 0;
    color: rgb(15 23 42);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5rem;
}

.bp-order-section__title--large {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.bp-order-section__description {
    margin: 0.15rem 0 0;
    color: rgb(100 116 139);
    font-size: 0.75rem;
    line-height: 1.125rem;
}

.bp-stat-grid {
    display: grid;
    gap: 1.25rem;
}

.bp-stat-grid--four,
.bp-stat-grid--shipping {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bp-stat-grid--five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bp-stat {
    min-width: 0;
}

.bp-stat dt,
.bp-field-label {
    display: block;
    margin-bottom: 0.35rem;
    color: rgb(100 116 139);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1rem;
}

.bp-stat dd {
    margin: 0;
    color: rgb(30 41 59);
    font-size: 0.85rem;
    font-weight: 650;
    line-height: 1.25rem;
}

.bp-stat strong {
    display: block;
    color: rgb(30 41 59);
    font-size: 0.85rem;
}

.bp-stat small {
    display: block;
    margin-top: 0.1rem;
    color: rgb(148 163 184);
    font-size: 0.65rem;
}

.bp-product-card + .bp-product-card {
    margin-top: 1rem;
}

.bp-product-card {
    overflow: hidden;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.65rem;
}

.bp-product-card__header {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    background: rgb(248 250 252);
    padding: 0.75rem 1rem;
}

.bp-product-card__header h3 {
    margin: 0;
    color: rgb(30 41 59);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2rem;
}

.bp-product-card__position {
    color: rgb(71 85 105);
    font-size: 0.75rem;
    font-weight: 700;
}

.bp-product-card__body {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr);
    gap: 1rem;
    padding: 1.1rem 1rem;
}

.bp-product-card__quantity strong {
    color: rgb(30 41 59);
    font-size: 0.9rem;
}

.bp-option-list {
    margin: 0;
}

.bp-option {
    display: grid;
    grid-template-columns: minmax(7.5rem, 10rem) minmax(0, 1fr);
    gap: 1rem;
    min-height: 1.7rem;
}

.bp-option + .bp-option {
    margin-top: 0.2rem;
}

.bp-option dt {
    color: rgb(100 116 139);
    font-size: 0.72rem;
    line-height: 1.25rem;
}

.bp-option dd {
    min-width: 0;
    margin: 0;
    color: rgb(30 41 59);
    font-size: 0.76rem;
    line-height: 1.25rem;
}

.bp-option__value {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}

.bp-option__text {
    min-width: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.bp-option__image {
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.35rem;
    object-fit: cover;
}

.bp-option__edit {
    flex: 0 0 auto;
    margin-left: auto;
    border: 0;
    background: transparent;
    padding: 0;
    color: rgb(37 99 235);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
}

.bp-media-link,
.bp-file-pill {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 0.45rem;
    color: rgb(37 99 235);
    text-decoration: none;
}

.bp-media-link span,
.bp-file-pill span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bp-file-pill {
    border: 1px solid rgb(219 234 254);
    border-radius: 999px;
    background: rgb(248 250 252);
    padding: 0.2rem 0.55rem;
}

.bp-file-pill__icon {
    width: 0.85rem;
    height: 0.85rem;
}

.bp-long-value p {
    margin: 0;
    white-space: pre-wrap;
}

.bp-long-value--collapsed {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.bp-option-editor {
    margin-top: 0.5rem;
    border-radius: 0.5rem;
    background: rgb(248 250 252);
    padding: 0.65rem;
}

.bp-option-editor__control {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid rgb(203 213 225);
    border-radius: 0.45rem;
    background: white;
    padding: 0.5rem 0.65rem;
    color: rgb(15 23 42);
    font: inherit;
}

.bp-option-editor__actions {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.5rem;
}

.bp-button {
    border: 1px solid rgb(203 213 225);
    border-radius: 0.4rem;
    background: white;
    padding: 0.35rem 0.65rem;
    color: rgb(51 65 85);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
}

.bp-button--primary {
    border-color: rgb(37 99 235);
    background: rgb(37 99 235);
    color: white;
}

.bp-address {
    display: flex;
    flex-direction: column;
    color: rgb(30 41 59);
    font-size: 0.76rem;
    font-style: normal;
    line-height: 1.15rem;
}

.bp-address__edit {
    display: inline-block;
    margin-top: 0.45rem;
}

.bp-link {
    color: rgb(37 99 235);
    font-weight: 500;
    text-decoration: none;
}

.bp-link:hover {
    text-decoration: underline;
}

.bp-link--button {
    display: block;
    margin-top: 0.2rem;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.bp-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.bp-table {
    width: 100%;
    border-collapse: collapse;
    color: rgb(51 65 85);
    font-size: 0.72rem;
    line-height: 1.1rem;
    text-align: left;
}

.bp-table--personalized,
.bp-table--shipments,
.bp-table--history {
    min-width: 58rem;
}

.bp-table--print-jobs {
    min-width: 52rem;
}

/* One card per Druckauftrag: header (number, status badge, provider facts
   in the Übersicht stat style, order-level files) + positions table. */
.bp-print-order {
    overflow: hidden;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.6rem;
}

.bp-print-order + .bp-print-order {
    margin-top: 1rem;
}

.bp-print-order__header {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    border-bottom: 1px solid rgb(226 232 240);
    background: rgb(248 250 252);
    padding: 0.9rem 1rem;
}

.bp-print-order__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.bp-print-order__number {
    color: rgb(15 23 42);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.25rem;
}

.bp-print-order__facts {
    margin: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem 1.25rem;
}

.bp-print-order__facts dd {
    font-size: 0.78rem;
}

.bp-print-order__facts .bp-file-list a {
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.1rem;
}

.bp-table th {
    background: rgb(248 250 252);
    padding: 0.55rem 0.65rem;
    color: rgb(100 116 139);
    font-size: 0.66rem;
    font-weight: 600;
    white-space: nowrap;
}

.bp-table td {
    border-bottom: 1px solid rgb(226 232 240);
    padding: 0.75rem 0.65rem;
    vertical-align: top;
}

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

.bp-table__strong {
    color: rgb(30 41 59);
    font-weight: 650;
}

.bp-table__empty {
    padding: 2rem !important;
    color: rgb(100 116 139);
    text-align: center;
}

.bp-table__chevron {
    width: 1.25rem;
    text-align: right;
}

.bp-table__chevron a {
    display: inline-flex;
    color: rgb(37 99 235);
}

.bp-table__chevron svg {
    width: 1rem;
    height: 1rem;
}

.bp-preview {
    display: flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.4rem;
    background: rgb(248 250 252);
}

.bp-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bp-preview__placeholder {
    width: 1rem;
    height: 1rem;
    color: rgb(148 163 184);
}

.bp-token-list,
.bp-file-list {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.bp-token-list code {
    color: rgb(100 116 139);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.65rem;
}

.bp-profile-list {
    margin: 0;
}

.bp-profile-list div {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr);
    gap: 0.4rem;
}

.bp-profile-list dt {
    color: rgb(100 116 139);
}

.bp-profile-list dd {
    margin: 0;
    color: rgb(30 41 59);
    font-weight: 550;
}

.bp-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    font-size: 0.66rem;
    font-weight: 650;
    line-height: 1rem;
    white-space: nowrap;
}

.bp-badge--success {
    background: rgb(220 252 231);
    color: rgb(21 128 61);
}

.bp-badge--info {
    background: rgb(219 234 254);
    color: rgb(29 78 216);
}

.bp-badge--warning {
    background: rgb(254 243 199);
    color: rgb(180 83 9);
}

.bp-badge--danger {
    background: rgb(254 226 226);
    color: rgb(185 28 28);
}

.bp-badge--gray {
    background: rgb(241 245 249);
    color: rgb(71 85 105);
}

.bp-empty-state {
    border: 1px dashed rgb(203 213 225);
    border-radius: 0.6rem;
    padding: 2rem;
    color: rgb(100 116 139);
    font-size: 0.8rem;
    text-align: center;
}

.bp-empty-inline,
.bp-muted {
    color: rgb(148 163 184);
}

.bp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.dark .bp-order-detail {
    color: rgb(203 213 225);
}

.dark .bp-order-section,
.dark .bp-product-card {
    border-color: rgb(255 255 255 / 0.1);
    background: rgb(17 24 39);
}

.dark .bp-order-section__header,
.dark .bp-table td {
    border-color: rgb(255 255 255 / 0.1);
}

.dark .bp-print-order {
    border-color: rgb(255 255 255 / 0.1);
}

.dark .bp-print-order__header {
    border-color: rgb(255 255 255 / 0.1);
    background: rgb(255 255 255 / 0.04);
}

.dark .bp-print-order__number {
    color: rgb(248 250 252);
}

.dark .bp-order-section__title,
.dark .bp-stat dd,
.dark .bp-stat strong,
.dark .bp-product-card__header h3,
.dark .bp-product-card__quantity strong,
.dark .bp-option dd,
.dark .bp-address,
.dark .bp-table__strong,
.dark .bp-profile-list dd {
    color: rgb(248 250 252);
}

.dark .bp-product-card__header,
.dark .bp-table th,
.dark .bp-option-editor,
.dark .bp-preview {
    background: rgb(255 255 255 / 0.04);
}

.dark .bp-option-editor__control,
.dark .bp-button {
    border-color: rgb(255 255 255 / 0.14);
    background: rgb(31 41 55);
    color: rgb(248 250 252);
}

.dark .bp-button--primary {
    border-color: rgb(59 130 246);
    background: rgb(37 99 235);
}

@media (max-width: 1024px) {
    .bp-stat-grid--five {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

@media (max-width: 768px) {
    .bp-order-section {
        padding: 1rem;
    }

    .bp-stat-grid--four,
    .bp-stat-grid--five {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bp-product-card__body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .bp-stat-grid--four,
    .bp-stat-grid--five,
    .bp-stat-grid--shipping,
    .bp-print-order__facts {
        grid-template-columns: 1fr;
    }

    .bp-option {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }
}
