:root {
    --pgr-red: #D02528;
    --pgr-red-dark: #AD1F21;
    --pgr-bg: #f4f5f7;
    --pgr-card: #ffffff;
    --pgr-border: #d9d9d9;
    --pgr-border-soft: #eeeeee;
    --pgr-text: #20242a;
    --pgr-muted: #667085;
    --pgr-soft-red: #fff1f1;
    --pgr-shadow: 0 8px 24px rgb(15 23 42 / 6%);
    --pgr-shadow-soft: 0 4px 14px rgb(15 23 42 / 5%);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 16px;
    background: var(--pgr-bg);
    color: var(--pgr-text);
    font-family: Inter, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 400;
}

.pgr-shell {
    max-width: 1400px;
    margin: 0 auto;
}

.pgr-app {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 18px;
}

.pgr-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pgr-card,
.pgr-content {
    background: var(--pgr-card);
    border: 1px solid var(--pgr-border);
    border-radius: 4px;
    box-shadow: var(--pgr-shadow-soft);
}

.pgr-cardTitle {
    padding: 12px 16px;
    border-bottom: 1px solid var(--pgr-border-soft);
    background: #ffffff;
    color: var(--pgr-text);
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .025em;
    text-transform: uppercase;
}

/* Modulnavigation */
.pgr-moduleNav {
    overflow: hidden;
}

.pgr-moduleHeader {
    padding: 14px 16px;
    border-bottom: 1px solid var(--pgr-border-soft);
}

.pgr-moduleHeader h3 {
    margin: 0;
    color: var(--pgr-text);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}


.pgr-moduleOverview span {
    display: block;
    color: var(--pgr-muted);
    font-size: 12px;
    font-weight: 700;
}

.pgr-moduleBtn {
    position: relative;
    min-height: 84px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--pgr-border-soft);

    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);

    align-items: center;
    gap: 12px;

    background: #ffffff;
    color: var(--pgr-text);
    text-decoration: none;

    transition:
        background-color .15s ease,
        color .15s ease;
}

.pgr-moduleBtn:hover {
    background: #fafafa;
}

.pgr-moduleIconArea {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pgr-moduleIcon {
    color: #667085;
    font-size: 18px;
    line-height: 1;

    width: auto;
    height: auto;
    border: 0;
    background: transparent;
}

.pgr-moduleText {
    min-width: 0;
}

.pgr-moduleText span {
    display: block;
    margin-bottom: 3px;
    color: var(--pgr-muted);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.pgr-moduleText strong {
    display: block;
    color: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
}

.pgr-moduleMain {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.pgr-moduleTopLine {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
}

.pgr-moduleAnsweredBadge {
    padding: 4px 7px;
    border: 1px solid #e3e7ee;
    border-radius: 4px;
    background: #f8fafc;
    color: #263241;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.pgr-modulePointLine {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;

    color: #667085;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

.pgr-modulePointLine em {
    color: #c4c9d3;
    font-style: normal;
}

.pgr-moduleBtnActive .pgr-moduleAnsweredBadge {
    border-color: rgb(255 255 255 / 36%);
    background: rgb(255 255 255 / 14%);
    color: #ffffff;
}

.pgr-moduleBtnActive .pgr-modulePointLine,
.pgr-moduleBtnActive .pgr-modulePointLine em {
    color: rgb(255 255 255 / 86%);
}

.pgr-moduleBtnActive {
    background: linear-gradient(135deg, var(--pgr-red), var(--pgr-red-dark));
    color: #ffffff;
    border-bottom-color: var(--pgr-red-dark);
    box-shadow: inset 4px 0 0 rgb(255 255 255 / 22%);
}

.pgr-moduleBtnActive:hover {
    background: linear-gradient(135deg, var(--pgr-red), var(--pgr-red-dark));
}

.pgr-moduleBtnActive::after,
.pgr-moduleBtnActive .pgr-moduleStatus,
.pgr-moduleBtnActive .pgr-moduleText span,
.pgr-moduleBtnActive .pgr-moduleMeta,
.pgr-moduleBtnActive .pgr-moduleMeta span:first-child {
    color: rgb(255 255 255 / 90%);
}

.pgr-moduleBtnActive .pgr-moduleIcon {
    color: #ffffff;
}

/* Ergebnis */
.pgr-resultBox {
    padding: 20px 16px 18px;
    text-align: center;
}

.pgr-resultBox span {
    display: block;
    margin-bottom: 2px;
    color: var(--pgr-muted);
    font-size: 13px;
    font-weight: 700;
}

.pgr-resultBox strong {
    display: block;
    color: var(--pgr-red);
    font-size: 48px;
    font-weight: 900;
    line-height: 1;
}

.pgr-resultBox em {
    display: block;
    margin-top: 10px;
    color: var(--pgr-red);
    font-style: normal;
    font-weight: 800;
    font-size: 12px;
}

.pgr-resultLine {
    padding: 10px 16px;
    border-top: 1px solid var(--pgr-border-soft);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}

.pgr-resultLine span {
    color: var(--pgr-muted);
}

.pgr-resultLine strong {
    color: var(--pgr-text);
}

.pgr-progressWrap {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--pgr-border-soft);
}

.pgr-progressBar {
    height: 9px;
    background: #eef0f3;
    border-radius: 4px;
    overflow: hidden;
}

.pgr-progressFill {
    height: 100%;
    background: linear-gradient(90deg, var(--pgr-red), var(--pgr-red-dark));
    border-radius: 4px;
}

.pgr-progressText {
    margin-top: 7px;
    color: var(--pgr-muted);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

/* Pflegegradgrenzen */
.pgr-gradeTable {
    padding: 12px 16px;
}

.pgr-gradeRow {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--pgr-border-soft);
    border-radius: 4px;
    margin-bottom: 6px;
    background: #ffffff;
    font-size: 12px;
}

.pgr-gradeRow span {
    font-weight: 900;
    color: var(--pgr-red);
}

.pgr-gradeRow strong {
    color: var(--pgr-text);
}

.pgr-gradeRowActive {
    border-color: var(--pgr-red);
    background: var(--pgr-soft-red);
}

.pgr-gradeHint {
    border-top: 1px solid var(--pgr-border-soft);
    padding: 11px 16px 14px;
    color: var(--pgr-muted);
    font-size: 12px;
    line-height: 1.45;
}

.pgr-gradeHint i {
    color: var(--pgr-red);
    margin-right: 4px;
}

/* Aktionen */
.pgr-actionCard {
    padding-bottom: 4px;
}

.pgr-actionGroupTitle {
    margin: 14px 16px 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--pgr-border-soft);
    color: var(--pgr-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pgr-actionBtn {
    width: calc(100% - 32px);
    min-height: 42px;
    margin: 0 16px 12px;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;

    box-shadow: 0 4px 10px rgb(15 23 42 / 8%);
    transition:
        background-color .15s ease,
        border-color .15s ease,
        transform .12s ease,
        box-shadow .15s ease;
}

.pgr-actionBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgb(15 23 42 / 14%);
}

.pgr-actionBtn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgb(15 23 42 / 10%);
}

.pgr-actionBtn i {
    font-size: 16px;
    line-height: 1;
}

.pgr-saveBtn {
    margin-top: 16px;
    border-color: var(--pgr-red-dark);
    background: var(--pgr-red);
}

.pgr-saveBtn:hover {
    background: var(--pgr-red-dark);
}

.pgr-loadBtn {
    border-color: #4b5563;
    background: #5b6573;
}

.pgr-loadBtn:hover {
    background: #4b5563;
}

.pgr-pdfBtn {
    border-color: #dc2626;
    background: #ffffff;
    color: #dc2626;
    text-decoration: none;
}

.pgr-pdfBtn:hover {
    background: #fff1f1;
    color: #b91c1c;
}

.pgr-resetBtn {
    border-color: var(--pgr-red);
    background: #ffffff;
    color: var(--pgr-red);
}

.pgr-resetBtn:hover {
    background: var(--pgr-soft-red);
}

/* Content Header */
.pgr-contentHeader {
    padding: 22px 24px;
    border-bottom: 1px solid var(--pgr-border);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fffafa 100%);
}

.pgr-contentHeader > div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 12px;
}

.pgr-contentHeader h1 {
    margin: 0;
    color: var(--pgr-text);
    font-size: clamp(15px, 1.2vw, 20px);
    line-height: 1.3;
    font-weight: 700;
    max-width: 900px;
}

.pgr-contentHeader p {
    order: -1;
    display: inline-flex;
    align-items: center;
    margin: 2px 0 0;
    padding: 7px 10px;
    border-radius: 4px;
    background: var(--pgr-red);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    align-self: start;
}

.pgr-infoBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: max-content;
    border: 1px solid var(--pgr-border);
    border-radius: 4px;
    padding: 9px 12px;
    background: #ffffff;
    color: var(--pgr-text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.pgr-infoBtn i {
    color: inherit;
}

.pgr-infoBtn:hover {
    border-color: var(--pgr-red);
    background: var(--pgr-red);
    color: #ffffff;
}

/* Tabelle */
.pgr-content {
    overflow: visible;
}

.pgr-table {
    display: grid;
    grid-template-columns: 90px minmax(300px, 1fr) repeat(4, minmax(140px, 1fr));
    min-width: 980px;
    overflow: visible;
}

.pgr-tableHead {
    position: sticky;
    top: 0;
    z-index: 50;
    align-self: start;
    padding: 10px 8px;
    background: var(--pgr-red);
    color: #ffffff;
    border-top: 1px solid var(--pgr-red-dark);
    border-bottom: 1px solid var(--pgr-red-dark);
    border-right: 1px solid var(--pgr-red-dark);
    font-weight: 600;
    text-align: center;
    font-size: 12px;
    line-height: 1.18;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pgr-tableHead.pgr-colCode {
    color: #ffffff;
}

.pgr-tableHead:first-child {
    border-left: 1px solid var(--pgr-red-dark);
}

.pgr-tableHeadLeft {
    justify-content: flex-start;
    text-align: left;
}

.pgr-cell {
    padding: 12px;
    border-bottom: 1px solid var(--pgr-border-soft);
    border-right: 1px solid var(--pgr-border-soft);
    min-height: 74px;
}

.pgr-colCode {
    font-weight: 800;
    color: var(--pgr-red);
}

.pgr-colQuestion {
    text-align: left;
}

.pgr-colQuestion strong {
    display: block;
    margin-bottom: 0;
}

.pgr-colQuestion span {
    display: block;
    color: var(--pgr-muted);
    font-size: 13px;
}

.pgr-answerCell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.pgr-radioWrap input {
    width: 20px;
    height: 20px;
    accent-color: var(--pgr-red);
    cursor: pointer;
}

/* Code-Badges und kleine Info-Buttons */
.pgr-codeBadge {
    border: 1px solid color-mix(in srgb, var(--pgr-red) 75%, white);
    background: #ffffff;
    color: var(--pgr-red);
    border-radius: 4px;
    padding: 5px 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.pgr-codeBadge:hover {
    background: var(--pgr-red);
    color: #ffffff;
}

.pgr-specialBadge {
    min-width: 74px;
    text-align: center;
}

.pgr-answerInfo {
    position: absolute;
    top: 0;
    right: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: 0;
    border-left: 1px solid #f4f5f7;
    border-bottom: 1px solid #f4f5f7;
    border-radius: 0 0 0 4px;
    background: #f7f7f7;
    color: #666666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    transition: all .15s ease;
}

.pgr-answerInfo:hover {
    background: var(--pgr-red);
    color: #ffffff;
    border-color: var(--pgr-red);
}

.pgr-inlineHint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--pgr-muted);
    line-height: 1.35;
}

.pgr-inlineHint i {
    color: var(--pgr-red);
    margin-right: 4px;
}

/* Besondere Bedarfskonstellation */
.pgr-specialBox {
    margin: 0;
    padding: 18px 22px;
    border-top: 1px solid var(--pgr-border);
    background: linear-gradient(180deg, #ffffff 0%, #fffafa 100%);
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 18px;
}

.pgr-specialBoxActive {
    background: #f7fff8;
    border-top: 3px solid #4caf50;
}

.pgr-specialIcon {
    width: 42px;
    height: 42px;
    border: 1px solid var(--pgr-border-soft);
    border-radius: 4px;
    background: #ffffff;
    color: var(--pgr-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
}

.pgr-specialIcon:hover {
    background: var(--pgr-red);
    color: #ffffff;
}

.pgr-specialMain {
    min-width: 0;
}

.pgr-specialTop {
    margin-bottom: 14px;
}

.pgr-specialEyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 6px;
    padding: 3px 7px;
    border-radius: 4px;
    background: #fafafa;
    color: var(--pgr-red);
    border: 1px solid var(--pgr-border-soft);
    font-size: 11px;
    font-weight: 700;
}

.pgr-specialTop strong {
    display: block;
    color: var(--pgr-text);
    margin-bottom: 4px;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 700;
}

.pgr-specialTop span:not(.pgr-specialEyebrow) {
    display: block;
    color: var(--pgr-muted);
    line-height: 1.4;
}

.pgr-specialCheck {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    line-height: 1.45;
    font-weight: 700;
    background: #ffffff;
    border: 1px solid var(--pgr-border-soft);
    border-radius: 4px;
    padding: 10px 12px;
}

.pgr-specialCheck input {
    margin-top: 4px;
    accent-color: var(--pgr-red);
}

.pgr-specialNote {
    margin-top: 10px;
    padding-left: 14px;
    color: var(--pgr-muted);
    font-size: 13px;
    line-height: 1.4;
}

/* Modul 4 Inline-Versorgung */
.pgr-inlineCareBox {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--pgr-border-soft);
    border-radius: 4px;
    background: #fafafa;
}

.pgr-inlineCareTitle {
    font-size: 12px;
    font-weight: 800;
    color: var(--pgr-red);
    margin-bottom: 8px;
}

.pgr-inlineCareTitle i {
    margin-right: 4px;
}

.pgr-inlineCareSubTitle {
    margin-top: 10px;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 800;
    color: var(--pgr-muted);
}

.pgr-inlineCareOptions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pgr-inlineCareOption {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #dddddd;
    border-radius: 4px;
    background: #ffffff;
    padding: 5px 7px;
    font-size: 12px;
    cursor: pointer;
}

.pgr-inlineCareOption input {
    accent-color: var(--pgr-red);
}

/* Modal */
.pgr-modal[hidden] {
    display: none;
}

.pgr-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.pgr-modalBackdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
}

.pgr-modalBox {
    position: relative;
    width: min(820px, 100%);
    max-height: 80vh;
    overflow: auto;
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #dddddd;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    padding: 28px;
    z-index: 2;
    margin: 0;
}

#pgr-modal-title {
    margin: 0 0 18px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pgr-border-soft);
    color: var(--pgr-red);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

#pgr-modal-content {
    white-space: pre-line;
    line-height: 1.55;
    color: var(--pgr-text);
    font-size: 15px;
    font-weight: 400;
}

.pgr-modalClose {
    position: absolute;
    right: 12px;
    top: 12px;
    border: 0;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}

/* Modul 5 */
.pgr-tableM5 {
    grid-template-columns: 90px minmax(340px, 1fr) 120px 130px 300px;
}

.pgr-m5FreqCell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pgr-m5Number {
    width: 80px;
    padding: 7px 8px;
    border: 1px solid #cccccc;
    border-radius: 4px;
}

.pgr-m5Select {
    min-width: 110px;
    padding: 7px 8px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    background: #ffffff;
}

.pgr-m5ScaleCell {
    grid-column: span 3;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pgr-m5ScaleOption {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #dddddd;
    border-radius: 4px;
    background: #ffffff;
    padding: 7px 9px;
    font-size: 12px;
    cursor: pointer;
}

.pgr-m5ScaleOption input {
    accent-color: var(--pgr-red);
}

/* Beantwortete Kriterien */
.pgr-rowAnswered {
    background: #ffffff;
}

.pgr-rowAnswered.pgr-colCode {
    box-shadow: none;
}

.pgr-rowAnswered .pgr-codeBadge {
    background: #3fa34d;
    border-color: #3fa34d;
    color: #ffffff;
    font-weight: 600;
}

.pgr-rowAnswered .pgr-codeBadge:hover {
    background: #3d9f41;
    border-color: #3d9f41;
    color: #ffffff;
}

/* ==========================================================
   Changelog Beta Hinweis
   ========================================================== */

.pgr-infoNotice {
    margin: 24px 0 22px 0;

    width: calc(100% + 60px);
    max-width: none;

    display: flex;
    align-items: flex-start;
    gap: 20px;

    padding: 18px 22px;

    background: #fff5f5;
    border: 1px solid #fecaca;
    border-left: 5px solid var(--pgr-red);

    border-radius: 4px;
}

.pgr-infoNoticeIcon {
    flex: 0 0 58px;

    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;
    border: 1px solid #fecaca;
    border-radius: 4px;
}

.pgr-infoNoticeIcon i {
    font-size: 32px;
    color: var(--pgr-red);
}

.pgr-infoNoticeContent {
    flex: 1;
    min-width: 0;
}

.pgr-infoNoticeContent strong {
    display: block;
    margin-bottom: 8px;

    color: var(--pgr-red-dark);

    font-size: 15px;
    font-weight: 800;
}

.pgr-infoNoticeContent p {
    margin: 0;

    background: none !important;
    padding: 0 !important;

    color: #7f1d1d !important;

    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 1000px) {
    body {
        padding: 10px;
    }

    .pgr-app {
        grid-template-columns: 1fr;
    }

    .pgr-table {
        grid-template-columns: 80px minmax(220px, 1fr) repeat(4, 110px);
    }

    .pgr-contentHeader {
        grid-template-columns: 1fr;
    }

    .pgr-infoBtn {
        justify-self: start;
    }
}

@media (max-width: 1200px) {
    .pgr-contentHeader {
        grid-template-columns: 1fr;
    }

    .pgr-infoBtn {
        justify-self: start;
    }
}