:root {
    --pp-app-bg: #f6f8fb;
    --pp-border: #d8e0ea;
    --pp-card-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    --pp-muted: #64748b;
    --pp-sidebar-bg: linear-gradient(180deg, #041737 0%, #06295f 100%);
    --pp-radius: .5rem;
}

html,
body {
    background: var(--pp-app-bg);
    color: #111827;
    font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a,
.btn-link {
    color: #0d6efd;
}

.btn {
    align-items: center;
    display: inline-flex;
    gap: .45rem;
    justify-content: center;
}

.btn-primary {
    box-shadow: 0 8px 18px rgba(13, 110, 253, .22);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .18);
}

.app-icon {
    flex: 0 0 auto;
}

.min-w-0 {
    min-width: 0;
}

.content {
    max-width: 1640px;
    width: 100%;
}

.page-header {
    align-items: flex-start;
    display: flex;
    gap: 1.25rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: clamp(1.85rem, 3vw, 2.55rem);
    font-weight: 800;
    line-height: 1.12;
    margin: 0;
}

.page-header-main {
    min-width: 0;
}

.page-header-actions,
.header-actions,
.form-action-buttons,
.pager,
.delete-strip,
.upload-panel {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.page-header-actions {
    justify-content: flex-end;
}

.eyebrow {
    color: #526782;
    font-size: .78rem;
    font-weight: 800;
    margin: 0 0 .4rem;
    text-transform: uppercase;
}

.page-subtitle,
.app-card-subtitle {
    color: var(--pp-muted);
    margin: .35rem 0 0;
}

.page-metadata {
    align-items: center;
    color: #526782;
    display: flex;
    flex-wrap: wrap;
    gap: .6rem 1rem;
    margin-top: .85rem;
}

.page-metadata span {
    align-items: center;
    display: inline-flex;
    gap: .35rem;
}

.app-card,
.empty-state,
.login-panel {
    background: #fff;
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    box-shadow: var(--pp-card-shadow);
}

.app-card {
    margin-bottom: 1.25rem;
}

.app-card-header {
    padding: 1.4rem 1.55rem 0;
}

.app-card-body {
    padding: 1.4rem 1.55rem;
}

.app-card-title {
    font-size: 1.08rem;
    font-weight: 800;
    margin: 0;
}

.icon-bubble {
    align-items: center;
    background: #eaf2ff;
    border-radius: 999px;
    color: #0d6efd;
    display: inline-flex;
    height: 2.65rem;
    justify-content: center;
    width: 2.65rem;
}

.metric-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1.25rem;
}

.metric-card {
    margin: 0;
}

.metric-card-body {
    align-items: center;
    display: flex;
    gap: 1.15rem;
}

.metric-icon {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    height: 4rem;
    justify-content: center;
    width: 4rem;
}

.metric-icon-blue {
    background: #e7f1ff;
    color: #0d6efd;
}

.metric-icon-green {
    background: #dcf7e7;
    color: #0f8a4a;
}

.metric-icon-yellow {
    background: #fff4cf;
    color: #b58100;
}

.metric-icon-red {
    background: #fee2e2;
    color: #b42318;
}

.metric-label,
.metric-helper {
    color: #526782;
    display: block;
    font-size: .88rem;
}

.metric-value {
    display: block;
    font-size: 1.65rem;
    line-height: 1.2;
}

.dashboard-grid {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.dashboard-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-stack {
    display: grid;
    gap: 1.25rem;
}

.dashboard-stack .app-card {
    margin-bottom: 0;
}

.dashboard-status-list,
.dashboard-value-list,
.dashboard-action-list,
.dashboard-completeness-list,
.dashboard-list {
    display: grid;
    gap: .85rem;
}

.dashboard-status-row,
.dashboard-completeness-row {
    display: grid;
    gap: .45rem;
}

.dashboard-status-row-header,
.dashboard-completeness-header,
.dashboard-value-row,
.dashboard-action-row,
.dashboard-list-row {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.dashboard-value-row,
.dashboard-action-row,
.dashboard-list-row {
    border-bottom: 1px solid var(--pp-border);
    padding-bottom: .75rem;
}

.dashboard-value-row:last-child,
.dashboard-action-row:last-child,
.dashboard-list-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.dashboard-action-link,
.dashboard-list-link {
    color: inherit;
    text-decoration: none;
}

.dashboard-action-link:hover,
.dashboard-list-link:hover {
    color: #0d6efd;
}

.dashboard-progress {
    background: #edf2f7;
    height: .55rem;
}

.inventory-toolbar {
    align-items: end;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(160px, 1fr) auto;
}

.filter-card .app-card-body {
    padding-bottom: 1.25rem;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
}

.active-filter-strip {
    align-items: center;
    display: flex;
    gap: .75rem;
    margin: -0.25rem 0 1rem;
}

.form-label {
    color: #182235;
    font-weight: 700;
}

.article-list-card .app-card-body {
    padding-top: 1rem;
}

.article-table {
    --bs-table-bg: transparent;
}

.article-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid var(--pp-border);
    color: #334155;
    font-size: .83rem;
    font-weight: 800;
    white-space: nowrap;
}

.article-table tbody td {
    color: #182235;
    vertical-align: middle;
}

.article-link {
    font-weight: 800;
    text-decoration: none;
}

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

.article-thumb {
    align-items: center;
    aspect-ratio: 1;
    background: #e9eef5;
    border-radius: .55rem;
    color: #475569;
    display: flex;
    font-weight: 800;
    height: 3.25rem;
    justify-content: center;
    overflow: hidden;
    width: 3.25rem;
}

.article-thumb img,
.image-gallery img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.article-mobile-list {
    display: none;
}

.article-mobile-card {
    color: inherit;
    display: grid;
    gap: .85rem;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 1rem 0;
    text-decoration: none;
}

.article-mobile-card + .article-mobile-card {
    border-top: 1px solid var(--pp-border);
}

.article-title-line,
.article-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .7rem;
}

.article-meta {
    color: var(--pp-muted);
    font-size: .9rem;
    margin-top: .25rem;
}

.badge.status-badge {
    border-radius: 999px;
    font-weight: 800;
    padding: .42rem .6rem;
}

.status-created {
    background: #ede9fe;
    color: #5b21b6;
}

.status-stored {
    background: #dbeafe;
    color: #075fc0;
}

.status-listed {
    background: #fef3c7;
    color: #92400e;
}

.status-sold {
    background: #dcfce7;
    color: #166534;
}

.pager {
    justify-content: space-between;
    margin-top: 1rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
}

.detail-layout {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr);
}

.detail-main {
    min-width: 0;
}

.details-list {
    display: grid;
    gap: 1.15rem 1.5rem;
    grid-template-columns: minmax(120px, .7fr) minmax(0, 1fr);
    margin: 1.5rem 0 0;
}

.details-list dt {
    color: #526782;
    font-weight: 800;
}

.details-list dd {
    margin: 0;
}

.detail-danger-zone {
    border-top: 1px solid var(--pp-border);
    margin-top: 1.6rem;
    padding-top: 1.4rem;
}

.note-box {
    white-space: pre-wrap;
}

.image-gallery {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    margin-bottom: 1.25rem;
}

.image-gallery figure,
.image-placeholder {
    background: #f8fafc;
    border: 1px solid var(--pp-border);
    border-radius: .5rem;
    margin: 0;
    min-height: 180px;
    overflow: hidden;
    position: relative;
}

.image-actions {
    bottom: .65rem;
    display: flex;
    gap: .45rem;
    position: absolute;
    right: .65rem;
}

.image-action-button {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    height: 2.35rem;
    justify-content: center;
    padding: 0;
    width: 2.35rem;
}

.image-download-button {
    color: #0f766e;
}

.image-delete-button {
    color: #dc3545;
}

.image-placeholder {
    align-items: center;
    color: var(--pp-muted);
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.upload-panel {
    border: 1px dashed #b8c5d6;
    border-radius: .5rem;
    padding: 1rem;
}

.upload-input {
    align-items: center;
    color: #0d6efd;
    display: flex;
    gap: 1rem;
    min-width: min(100%, 340px);
}

.upload-input input {
    color: #334155;
    display: block;
    margin-top: .55rem;
    max-width: 100%;
}

.article-form-sections {
    display: grid;
    gap: 1.1rem;
}

.article-form-sections .app-card {
    margin-bottom: 0;
}

.part-lookup-grid {
    align-items: end;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(200px, auto);
}

.form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field.span-2 {
    grid-column: span 2;
}

.form-actions {
    justify-content: space-between;
    margin-top: 1.25rem;
}

.suggestion-panel {
    display: grid;
    gap: .75rem;
}

.suggestion-result {
    margin: 0;
}

.delete-strip {
    justify-content: flex-start;
}

.login-shell {
    align-items: center;
    background:
        radial-gradient(circle at right center, rgba(13, 110, 253, .08), transparent 34rem),
        var(--pp-app-bg);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 1.25rem;
}

.login-panel {
    max-width: 460px;
    padding: clamp(1.5rem, 5vw, 3rem);
    text-align: center;
    width: min(100%, 460px);
}

.login-brand {
    align-items: center;
    color: #0b1b34;
    display: inline-flex;
    font-size: 1.7rem;
    font-weight: 850;
    gap: .75rem;
    justify-content: center;
    margin-bottom: 1.75rem;
}

.login-panel h1 {
    font-size: clamp(2rem, 6vw, 2.6rem);
    font-weight: 850;
}

.login-subtitle {
    border-bottom: 1px solid var(--pp-border);
    color: var(--pp-muted);
    margin: 0 0 1.5rem;
    padding-bottom: 1.5rem;
}

.login-panel form {
    text-align: left;
}

.login-panel form h1,
.login-panel .login-subtitle {
    text-align: center;
}

.login-panel .form-label {
    margin-top: 1rem;
}

.login-panel .btn {
    margin-top: 1.5rem;
}

@media (max-width: 1199.98px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid-two {
        grid-template-columns: 1fr;
    }

    .inventory-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-search {
        grid-column: span 2;
    }

    .filter-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 991.98px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .form-grid-three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header-actions,
    .page-header-actions .btn,
    .form-action-buttons,
    .form-action-buttons .btn,
    .pager .btn-group,
    .pager .btn {
        width: 100%;
    }

    .metric-grid,
    .dashboard-kpi-grid,
    .inventory-toolbar,
    .form-grid,
    .form-grid-three,
    .part-lookup-grid {
        grid-template-columns: 1fr;
    }

    .filter-search,
    .field.span-2 {
        grid-column: auto;
    }

    .article-table-wrap {
        display: none;
    }

    .article-mobile-list {
        display: block;
    }

    .details-list {
        grid-template-columns: 1fr;
        gap: .3rem;
    }

    .details-list dd {
        margin-bottom: .75rem;
    }

    .image-gallery {
        grid-template-columns: 1fr;
    }

    .upload-panel,
    .form-actions,
    .pager {
        align-items: stretch;
        flex-direction: column;
    }

    .app-card-header {
        padding: 1.1rem 1rem 0;
    }

    .app-card-body {
        padding: 1.1rem 1rem;
    }
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #dc3545;
}

.validation-message {
    color: #dc3545;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    color: white;
    padding: 1rem;
}

.blazor-error-boundary::after {
    content: "Es ist ein Fehler aufgetreten.";
}

.loading-progress {
    display: block;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
    position: absolute;
    width: 8rem;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    position: absolute;
    text-align: center;
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Wird geladen");
}

code {
    color: #c02d76;
}
