/* CONNECTOR_PROJECT_RISKS_DESKTOP_V1 */
.ro-modal-box{width:min(1580px,98vw);max-height:96vh;padding:0;gap:0;overflow:hidden;border-radius:22px}
.ro-modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:20px 22px;background:linear-gradient(135deg,#0f172a,#14532d 58%,#15803d);color:#fff}
.ro-modal-header h2{margin:6px 0 0;color:#fff;font-size:22px;line-height:1.2}.ro-modal-header-main{min-width:0}.ro-modal-header-badges{display:flex;gap:8px;flex-wrap:wrap}
.ro-badge{display:inline-flex;align-items:center;min-height:25px;padding:5px 9px;border:1px solid rgba(255,255,255,.2);border-radius:999px;background:rgba(255,255,255,.14);color:#fff;font-size:10px;font-weight:900;letter-spacing:.06em}.ro-badge.closed{border-color:#fecaca;background:#fee2e2;color:#991b1b}
.ro-modal-close,.ro-form-header button{display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;margin:0;padding:0;border:1px solid rgba(255,255,255,.15);border-radius:12px;background:rgba(255,255,255,.12);color:#fff;cursor:pointer}.ro-modal-close:hover,.ro-form-header button:hover{background:rgba(255,255,255,.22)}
.ro-modal-scroll{min-height:0;padding:18px;overflow:auto;background:#f1f5f9}
.ro-loading,.ro-error{display:flex;min-height:220px;flex-direction:column;align-items:center;justify-content:center;gap:9px;padding:30px;border:1px dashed #cbd5e1;border-radius:17px;background:#fff;color:#64748b;text-align:center}.ro-loading i,.ro-error i{font-size:30px}.ro-error{border-color:#fecaca;background:#fff7f7;color:#b91c1c}.ro-loading.compact,.ro-error.compact{min-height:90px;padding:18px}
.ro-summary-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:11px;margin-bottom:14px}.ro-summary-card{min-width:0;padding:14px;border:1px solid #e2e8f0;border-top:4px solid #64748b;border-radius:16px;background:#fff;box-shadow:0 8px 20px rgba(15,23,42,.055)}
.ro-summary-card.risk{border-top-color:#dc2626;background:#fff7f7}.ro-summary-card.opportunity{border-top-color:#16a34a;background:#f0fdf4}.ro-summary-card.exposure{border-top-color:#b91c1c}.ro-summary-card.value{border-top-color:#15803d}.ro-summary-card.net{border-top-color:#2563eb}.ro-summary-card.danger{border-top-color:#dc2626;background:#fff7f7}.ro-summary-card.overdue{border-top-color:#f59e0b}
.ro-summary-card span,.ro-summary-card strong,.ro-summary-card small{display:block}.ro-summary-card span{color:#64748b;font-size:10px;font-weight:900;letter-spacing:.045em;text-transform:uppercase}.ro-summary-card strong{margin-top:6px;color:#0f172a;font-size:20px;line-height:1.15;overflow-wrap:anywhere}.ro-summary-card small{margin-top:5px;color:#64748b;font-size:10px;line-height:1.35}
.ro-toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:12px;padding:15px;border:1px solid #bbf7d0;border-radius:17px;background:#fff;box-shadow:0 7px 18px rgba(20,83,45,.045)}.ro-toolbar h3{margin:0;color:#0f172a;font-size:17px}.ro-toolbar p{max-width:860px;margin:5px 0 0;color:#64748b;font-size:11px;line-height:1.45}
.ro-new-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;margin:0;padding:10px 14px;border:0;border-radius:12px;background:#15803d;color:#fff;font-weight:900;cursor:pointer;box-shadow:0 8px 18px rgba(21,128,61,.2)}.ro-new-button:hover{background:#166534}.ro-new-button:disabled{background:#e2e8f0;color:#94a3b8;box-shadow:none;cursor:not-allowed}
.ro-filter-bar{display:flex;align-items:center;gap:8px;margin-bottom:9px;padding:8px;border:1px solid #e2e8f0;border-radius:14px;background:#fff;overflow:auto}.ro-filter-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px;margin:0;padding:8px 11px;border:1px solid transparent;border-radius:10px;background:#f8fafc;color:#475569;font-size:11px;font-weight:900;white-space:nowrap;cursor:pointer}.ro-filter-button span{display:grid;place-items:center;min-width:22px;height:22px;padding:0 5px;border-radius:999px;background:#e2e8f0;color:#334155;font-size:9px}.ro-filter-button:hover{border-color:#cbd5e1;background:#fff}.ro-filter-button.active{border-color:#86efac;background:#f0fdf4;color:#166534}.ro-filter-button.active span{background:#dcfce7;color:#166534}
.ro-result-caption{margin:0 2px 8px;color:#64748b;font-size:10px}.ro-result-caption strong{color:#334155}
.ro-table-wrap{overflow:auto;border:1px solid #dbe3ee;border-radius:16px;background:#fff;box-shadow:0 8px 24px rgba(15,23,42,.05)}.ro-table{width:100%;min-width:1540px;margin:0;border-collapse:separate;border-spacing:0;border-radius:0;background:#fff;box-shadow:none}.ro-table thead th{position:sticky;top:0;z-index:2;padding:12px 11px;border-bottom:1px solid #cbd5e1;background:#eaf0f7;color:#334155;font-size:10px;font-weight:900;letter-spacing:.045em;text-align:left;text-transform:uppercase;white-space:nowrap}.ro-table tbody td{padding:13px 11px;border-bottom:1px solid #edf2f7;background:#fff;color:#334155;font-size:11px;line-height:1.4;vertical-align:top;white-space:normal}.ro-table tbody tr:last-child td{border-bottom:0}.ro-table tbody tr:hover td{background:#f8fafc}.ro-table tbody tr.risk td:first-child{box-shadow:inset 4px 0 #dc2626}.ro-table tbody tr.opportunity td:first-child{box-shadow:inset 4px 0 #16a34a}.ro-table tbody tr.overdue td{background:#fffbeb}.ro-table tbody tr.severity-critical td{border-top:1px solid #fecaca;border-bottom-color:#fecaca}
.ro-table td>strong,.ro-table td>small{display:block}.ro-table td>strong{color:#0f172a;font-size:12px}.ro-table td>small{margin-top:4px;color:#64748b;font-size:9px;line-height:1.35}
.ro-number{display:inline-flex!important;align-items:center;padding:6px 9px;border-radius:9px;font-size:12px!important;font-weight:950;white-space:nowrap}.ro-number.risk{background:#fee2e2;color:#991b1b!important}.ro-number.opportunity{background:#dcfce7;color:#166534!important}.ro-description{display:-webkit-box;max-width:300px;margin:7px 0 0;overflow:hidden;color:#475569;font-size:10px;line-height:1.4;-webkit-box-orient:vertical;-webkit-line-clamp:3}.ro-relations{display:flex;gap:5px;flex-wrap:wrap;margin-top:7px}.ro-relations span{display:inline-flex;align-items:center;gap:4px;padding:4px 6px;border-radius:999px;background:#eff6ff;color:#1d4ed8;font-size:8px;font-weight:900}.ro-overdue{display:inline-flex;margin-top:6px;padding:4px 7px;border-radius:999px;background:#fef3c7;color:#92400e;font-size:8px;font-weight:900}
.ro-severity{display:inline-flex;padding:6px 8px;border-radius:999px;background:#e2e8f0;color:#475569;font-size:9px;font-weight:900}.ro-severity.low{background:#e0f2fe;color:#075985}.ro-severity.medium{background:#fef3c7;color:#92400e}.ro-severity.high{background:#ffedd5;color:#9a3412}.ro-severity.critical{background:#fee2e2;color:#991b1b}
.ro-money{display:grid;gap:5px;min-width:150px}.ro-money span{display:flex;justify-content:space-between;gap:12px;color:#64748b;font-size:9px}.ro-money strong{color:#0f172a;font-size:10px;white-space:nowrap}.ro-plan{display:-webkit-box;max-width:250px;margin:6px 0 0;overflow:hidden;color:#64748b;font-size:10px;line-height:1.4;-webkit-box-orient:vertical;-webkit-line-clamp:3}
.ro-status{display:inline-flex;align-items:center;width:max-content;max-width:180px;padding:6px 9px;border-radius:999px;background:#e2e8f0;color:#475569;font-size:9px;font-weight:900;line-height:1.25;text-align:center}.ro-status.open{background:#dbeafe;color:#1d4ed8}.ro-status.monitoring{background:#fef3c7;color:#92400e}.ro-status.action{background:#ede9fe;color:#6d28d9}.ro-status.materialized{background:#fee2e2;color:#991b1b}.ro-status.realized{background:#dcfce7;color:#166534}.ro-status.closed{background:#e2e8f0;color:#334155}.ro-status.cancelled{background:#f1f5f9;color:#64748b}.ro-ctc-link{display:inline-flex!important;align-items:center;gap:4px;margin-top:7px!important;padding:4px 6px;border-radius:999px;background:#ede9fe;color:#6d28d9!important;font-weight:900}
.ro-actions{display:flex;gap:6px;flex-wrap:wrap}.ro-actions button{display:grid;place-items:center;width:35px;height:35px;margin:0;padding:0;border:0;border-radius:9px;background:#2563eb;color:#fff;cursor:pointer}.ro-actions button.ctc{background:#7c3aed}.ro-actions button.danger{background:#dc2626}.ro-actions button:hover{filter:brightness(.94)}
.ro-empty{display:flex;min-height:190px;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:25px;border:1px dashed #cbd5e1;border-radius:16px;background:#fff;color:#64748b;text-align:center}.ro-empty i{color:#94a3b8;font-size:31px}.ro-empty strong{color:#334155;font-size:16px}.ro-empty.compact{min-height:80px}
.ro-form-box{width:min(1120px,96vw);max-height:95vh;padding:0;gap:0;overflow:hidden;border-radius:20px}.ro-form-header{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;padding:18px 20px;background:linear-gradient(135deg,#0f172a,#166534);color:#fff}.ro-form-header h2{margin:0;color:#fff;font-size:20px}.ro-form-header p{margin:5px 0 0;color:#dcfce7;font-size:11px}.ro-form-scroll{min-height:0;padding:18px;overflow:auto;background:#f8fafc}.ro-form-section{margin-bottom:14px;padding:15px;border:1px solid #dbe3ee;border-radius:16px;background:#fff}.ro-form-section h3{display:flex;align-items:center;gap:8px;margin:0 0 12px;color:#0f172a;font-size:15px}.ro-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.ro-form-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.ro-field{display:grid;gap:6px;margin:0}.ro-field.full{grid-column:1/-1}.ro-field>span{color:#475569;font-size:11px;font-weight:900}.ro-field input,.ro-field select,.ro-field textarea{width:100%;min-width:0;min-height:43px;padding:10px 11px;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:11px;background:#fff;color:#0f172a;outline:none}.ro-field textarea{min-height:96px;resize:vertical}.ro-field input:focus,.ro-field select:focus,.ro-field textarea:focus{border-color:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.13)}
.ro-calculation-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:12px}.ro-calculation-card{padding:11px;border-radius:12px;background:#f0fdf4}.ro-calculation-card span,.ro-calculation-card strong{display:block}.ro-calculation-card span{color:#64748b;font-size:9px;font-weight:900;text-transform:uppercase}.ro-calculation-card strong{margin-top:4px;color:#166534;font-size:17px}
.ro-form-actions{display:flex;justify-content:flex-end;gap:9px;padding:14px 18px;border-top:1px solid #e2e8f0;background:#fff}.ro-form-actions button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:42px;margin:0;padding:9px 13px;border:0;border-radius:11px;background:#15803d;color:#fff;font-weight:900;cursor:pointer}.ro-form-actions button.secondary{background:#e2e8f0;color:#334155}
.ro-small-box{width:min(660px,94vw);max-height:92vh;padding:0;gap:0;overflow:hidden;border-radius:18px}.ro-warning-box{display:flex;gap:10px;margin-bottom:12px;padding:12px;border:1px solid #fde68a;border-radius:12px;background:#fffbeb;color:#92400e;font-size:11px;line-height:1.45}.ro-history-list{display:grid;gap:9px}.ro-history-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:12px;border:1px solid #e2e8f0;border-radius:12px;background:#fff}.ro-history-item strong,.ro-history-item span{display:block}.ro-history-item strong{color:#0f172a}.ro-history-item span{margin-top:3px;color:#64748b;font-size:9px}.ro-history-item small{color:#475569;font-weight:900}.ro-history-item p{grid-column:1/-1;margin:4px 0 0;color:#475569;font-size:10px}
.ro-sheet-actions{display:flex;justify-content:flex-end;margin-bottom:10px}.ro-sheet-actions button{display:inline-flex;align-items:center;gap:7px;min-height:40px;margin:0;padding:9px 12px;border:0;border-radius:11px;background:#15803d;color:#fff;font-weight:900}.ro-sheet-actions button span{display:grid;place-items:center;min-width:22px;height:22px;padding:0 5px;border-radius:999px;background:rgba(255,255,255,.18);font-size:9px}.pc-sheet-metric.risk-adjusted>i{background:#dcfce7;color:#166534}.pc-sheet-metric.risk-danger{border-color:#fecaca;background:#fff7f7}.pc-sheet-metric.risk-danger>i{background:#fee2e2;color:#b91c1c}
@media(max-width:1200px){.ro-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.ro-form-grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.ro-modal-scroll,.ro-form-scroll{padding:10px}.ro-summary-grid,.ro-form-grid,.ro-form-grid.three,.ro-calculation-grid{grid-template-columns:1fr}.ro-toolbar{align-items:stretch;flex-direction:column}.ro-new-button{width:100%}.ro-form-actions{display:grid;grid-template-columns:1fr 1fr}.ro-table-wrap{border:0;box-shadow:none;overflow:visible}.ro-table{display:block;min-width:0}.ro-table thead{display:none}.ro-table tbody{display:grid;gap:10px}.ro-table tr{display:grid;padding:12px;border:1px solid #dbe3ee;border-radius:15px;background:#fff}.ro-table tbody tr.risk,.ro-table tbody tr.opportunity{border-left-width:5px}.ro-table tbody tr.risk{border-left-color:#dc2626}.ro-table tbody tr.opportunity{border-left-color:#16a34a}.ro-table tbody td{display:grid;grid-template-columns:105px minmax(0,1fr);gap:8px;padding:7px 0;border:0;background:transparent!important}.ro-table tbody td:before{content:attr(data-label);color:#64748b;font-size:9px;font-weight:900;text-transform:uppercase}.ro-table tbody td:first-child{box-shadow:none!important}.ro-actions{justify-content:flex-start}}

/* CONNECTOR_STAGE_07_1_RISKS_FORM_SCROLL_FIX_V1 */
/*
Formularz zajmuje dostępną wysokość modala.
Przewija się tylko jego środek, a przyciski
Anuluj i Zapisz pozostają stale widoczne.
*/
.ro-form-box {
    display: flex;
    flex-direction: column;

    width: min(1120px, 96vw);
    height: min(95vh, 960px);
    max-height: 95vh;
    min-height: 0;

    padding: 0;
    gap: 0;

    overflow: hidden;
    border-radius: 20px;
}

.ro-form-box > .ro-form-header {
    flex: 0 0 auto;
}

.ro-form-box > form {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;

    flex-direction: column;
    overflow: hidden;
}

.ro-form-box > form > .ro-form-scroll {
    flex: 1 1 auto;
    min-height: 0;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

.ro-form-box > form > .ro-form-actions {
    position: relative;
    z-index: 3;

    flex: 0 0 auto;

    box-shadow:
        0 -8px 22px
        rgba(15, 23, 42, 0.08);
}

/*
Przyciski modułów w karcie budżetu
są wyświetlane w jednym wierszu.
*/
.pc-sheet-module-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;
    margin-bottom: 12px;

    flex-wrap: wrap;
}

.pc-sheet-module-actions .co-sheet-actions,
.pc-sheet-module-actions .ro-sheet-actions {
    display: flex;
    justify-content: flex-end;

    margin: 0;
}

.pc-sheet-module-actions button {
    min-height: 42px;
    white-space: nowrap;
}

@media (max-width: 760px) {

    .ro-form-box {
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;

        border-radius: 0;
    }

    .pc-sheet-module-actions {
        display: grid;

        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 8px;
    }

    .pc-sheet-module-actions .co-sheet-actions,
    .pc-sheet-module-actions .ro-sheet-actions,
    .pc-sheet-module-actions button {
        width: 100%;
    }
}

