:root {
    --portal-gap: 24px;
}

.portal-backnav {
    margin-bottom: 12px;
}

.portal-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.portal-section-actions {
    margin-top: 16px;
}

.portal-content-html {
    color: #334155;
    line-height: 1.6;
}

.portal-content-html > :first-child { margin-top: 0; }
.portal-content-html > :last-child { margin-bottom: 0; }
.portal-content-html p,
.portal-content-html ul,
.portal-content-html ol,
.portal-content-html table { margin: 0 0 12px 0; }
.portal-content-html ul,
.portal-content-html ol { padding-left: 20px; }
.portal-content-html table { width: 100%; border-collapse: collapse; }
.portal-content-html th,
.portal-content-html td { border: 1px solid #e2e8f0; padding: 8px 10px; }

.procurement-page h1,
.procurement-detail-page h1,
.procurement-detail-page h2 {
    margin-top: 0;
}

.procurement-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-top: 18px;
}
.procurement-search {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.procurement-search input {
    min-width: 280px;
    padding: 12px 14px;
    border: 1px solid #dbe3ea;
    border-radius: 12px;
    font-size: 14px;
}
.procurement-count { color: #64748b; font-size: 14px; }
.procurement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 20px;
}
.proc-card {
    border: 1px solid #dbe3ea;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15,23,42,.04);
    overflow: hidden;
}
.proc-card-media {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    padding: 14px;
}
.proc-card-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
    cursor: default;
    background: #fff;
}
.proc-card-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: #64748b;
    background: #fff;
    font-size: 14px;
    text-align: center;
    padding: 16px;
}
.proc-card-body { padding: 16px; }
.proc-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.proc-maker { font-size: 12px; color: #64748b; margin-bottom: 4px; }
.proc-artnr { font-size: 13px; color: #64748b; margin-bottom: 4px; }
.proc-title { font-size: 16px; font-weight: 700; color: #0f172a; line-height: 1.35; }
.proc-logo { width: 54px; height: 28px; object-fit: contain; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 4px; pointer-events: none; cursor: default; }
.proc-meta-stack { display: grid; gap: 10px; margin-top: 16px; }
.proc-meta-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 10px 12px; }
.proc-meta-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin-bottom: 4px; }
.proc-meta-value { font-size: 14px; color: #0f172a; font-weight: 700; }
.proc-actions { margin-top: 16px; }
.proc-empty { margin-top: 22px; padding: 18px; border: 1px dashed #cbd5e1; border-radius: 16px; background: #f8fafc; color: #475569; }
.proc-pagination { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }

.pd-top {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.pd-gallery {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 18px;
}
.pd-main-image {
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pd-image-button,
.pd-thumb-button {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}
.pd-main-image img {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
    background: #fff;
    border-radius: 18px;
}
.pd-image-empty,
.pd-variant-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 220px;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    background: #fff;
    color: #64748b;
    text-align: center;
    padding: 16px;
}
.pd-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.pd-thumbs img {
    width: 100%;
    height: 72px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px;
}
.pd-summary { min-width: 0; }
.pd-maker-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.pd-title {
    font-size: 30px;
    line-height: 1.15;
    color: #0f172a;
    font-weight: 700;
    margin: 4px 0 0 0;
}
.pd-logo {
    max-width: 180px;
    max-height: 64px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 8px;
}
.pd-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}
.pd-meta-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.pd-kpi {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 14px;
    min-width: 0;
}
.pd-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #64748b; margin-bottom: 6px; }
.pd-kpi-value { font-size: 16px; font-weight: 700; color: #0f172a; word-break: break-word; }
.pd-note { margin-top: 12px; font-size: 13px; color: #64748b; line-height: 1.5; }
.stock-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.stock-red { background: #fee2e2; color: #b91c1c; }
.stock-orange { background: #ffedd5; color: #c2410c; }
.stock-green { background: #dcfce7; color: #166534; }
.stock-neutral { background: #e2e8f0; color: #334155; }

.pd-section { margin-top: 24px; }
.pd-desc-box,
.pd-price-chart,
.pd-history-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 18px;
}
.pd-variants-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}
.pd-variant-tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    padding: 12px;
}
.pd-variant-tile:hover {
    border-color: #94a3b8;
    box-shadow: 0 4px 14px rgba(15,23,42,.06);
}
.pd-variant-media {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px;
}
.pd-variant-media img { width: 100%; height: 78px; object-fit: contain; background: #fff; }
.pd-variant-title { font-size: 13px; font-weight: 700; color: #0f172a; }
.pd-variant-text { font-size: 12px; color: #475569; line-height: 1.45; }
.pd-variant-stock { font-size: 12px; color: #334155; margin-top: auto; }
.pd-history-list { display: grid; gap: 14px; }
.pd-history-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.pd-history-number { margin-top: 10px; font-size: 20px; font-weight: 700; color: #0f172a; }
.pd-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-badge { padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pd-badge-order { background: #dbeafe; color: #1d4ed8; }
.pd-badge-delivery { background: #dcfce7; color: #166534; }
.pd-badge-invoice { background: #f3e8ff; color: #7e22ce; }
.pd-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.pd-table-cell {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px;
    min-width: 0;
}
.pd-table-cell-wide { grid-column: span 1; }
.pd-address-text {
    font-size: 14px;
    font-weight: 400;
    color: #0f172a;
    line-height: 1.5;
}
.pd-small { font-size: 13px; color: #64748b; }
.pd-value { font-size: 15px; font-weight: 700; color: #0f172a; margin-top: 4px; }
.pd-price-chart svg { width: 100%; height: 220px; display: block; }
.pd-price-chart-axis { stroke: #cbd5e1; stroke-width: 1; }
.pd-price-chart-line { fill: none; stroke: #2563eb; stroke-width: 2; }
.pd-price-chart-point { fill: #2563eb; }
.pd-price-chart-label { font-size: 11px; fill: #64748b; }

@media (max-width: 1100px) {
    .pd-variants-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .pd-top { grid-template-columns: 1fr; }
    .pd-main-image { min-height: 280px; }
    .pd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pd-variants-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .procurement-search input { min-width: 100%; width: 100%; }
    .pd-kpis,
    .pd-meta-inline,
    .pd-table,
    .pd-variants-grid { grid-template-columns: 1fr; }
    .pd-title { font-size: 26px; }
}
