/* Rejestr BHP - style */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f6f7f8;
    color: #17212b;
}

/* Kreator instrukcji stanowiskowych */
.instruction-wizard-header {
    align-items: flex-start;
    margin-bottom: 18px;
}
.instruction-wizard-header .eyebrow {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 5px;
    text-transform: uppercase;
}
.instruction-wizard-header h1 {
    margin-bottom: 6px;
}
.instruction-template-switch {
    background: #e7ebf0;
    border-radius: 7px;
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(130px, 1fr));
    margin-bottom: 18px;
    padding: 4px;
}
.instruction-template-switch a {
    border-radius: 5px;
    color: #3b4859;
    font-weight: 700;
    padding: 10px 16px;
    text-align: center;
    text-decoration: none;
}
.instruction-template-switch a.active {
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 31, 52, .12);
    color: var(--brand);
}
.instruction-wizard-form {
    display: grid;
    gap: 14px;
}
.instruction-step {
    margin: 0;
    padding: 0;
}
.instruction-step summary {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 13px;
    grid-template-columns: 38px minmax(0, 1fr);
    list-style: none;
    padding: 18px 22px;
}
.instruction-step summary::-webkit-details-marker {
    display: none;
}
.instruction-step summary::after {
    color: var(--muted);
    content: '+';
    font-size: 24px;
    grid-column: 3;
    line-height: 1;
}
.instruction-step[open] summary::after {
    content: '−';
}
.instruction-step summary > span:nth-child(2) {
    display: grid;
    gap: 4px;
}
.instruction-step summary strong {
    color: var(--navy);
    font-size: 17px;
}
.instruction-step summary small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}
.instruction-step-number {
    align-items: center;
    background: #fff0e5;
    border: 1px solid #ffd1af;
    border-radius: 50%;
    color: var(--brand);
    display: inline-flex;
    font-size: 15px;
    font-weight: 800;
    height: 38px;
    justify-content: center;
    width: 38px;
}
.instruction-step-content {
    border-top: 1px solid var(--line);
    padding: 20px 22px 22px;
}
.instruction-step-content textarea {
    line-height: 1.55;
}
.soi-picker {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.soi-toolbar {
    align-items: center;
    display: grid;
    gap: 8px 12px;
    grid-template-columns: auto minmax(220px, 420px) 1fr;
    margin-bottom: 14px;
}
.soi-toolbar label {
    color: var(--navy);
    font-size: 13px;
    font-weight: 700;
}
.soi-toolbar input {
    margin: 0;
}
.soi-toolbar span {
    color: var(--muted);
    font-size: 13px;
}
.soi-option[hidden] {
    display: none;
}
.soi-option {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: 24px 58px minmax(0, 1fr);
    min-height: 94px;
    padding: 12px;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.soi-option:hover {
    border-color: #ffb77e;
}
.soi-option.is-selected,
.soi-option:has(input:checked) {
    background: #fff8f2;
    border-color: var(--brand);
    box-shadow: 0 0 0 1px var(--brand);
}
.soi-option input {
    height: 18px;
    margin: 0;
    width: 18px;
}
.soi-option img {
    height: 58px;
    object-fit: contain;
    width: 58px;
}
.soi-option span {
    display: grid;
    gap: 5px;
    min-width: 0;
}
.soi-option strong {
    color: var(--navy);
    font-size: 14px;
    line-height: 1.3;
}
.soi-option small {
    color: var(--muted);
    font-size: 12px;
}
.instruction-standard-note {
    border-left: 3px solid #2f79d2;
    margin: 16px 0 0;
    padding-left: 12px;
}
.instruction-wizard-save {
    align-items: center;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin: 0;
}
.instruction-wizard-save p {
    margin: 5px 0 0;
}
.instruction-register-intro {
    align-items: center;
    display: flex;
    gap: 24px;
    justify-content: space-between;
}
.instruction-register-intro p {
    margin: 5px 0 0;
}
.instruction-kind {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 3px;
}

@media (max-width: 720px) {
    .instruction-template-switch {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }
    .instruction-step summary {
        grid-template-columns: 34px minmax(0, 1fr) 20px;
        padding: 15px;
    }
    .instruction-step-number {
        height: 34px;
        width: 34px;
    }
    .instruction-step-content {
        padding: 16px 15px 18px;
    }
    .soi-picker {
        grid-template-columns: 1fr;
    }
    .soi-toolbar {
        align-items: stretch;
        grid-template-columns: 1fr;
    }
    .instruction-wizard-save,
    .instruction-register-intro {
        align-items: stretch;
        flex-direction: column;
    }
}

.employee-account-link {
    border: 1px solid #d8dee7;
    background: #f8fafc;
    padding: 14px;
    margin-bottom: 16px;
}

.employee-account-link > label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
}

.employee-account-link .form-row {
    margin: 14px 0 0;
}

.readonly-field {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid #d8dee7;
    background: #f8fafc;
}

.instruction-workflow-actions {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.workflow-action-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid #d8dee7;
    background: #fff;
}

.workflow-action-card strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.workflow-action-card p {
    color: #64748b;
    margin: 0 0 10px;
}

.workflow-action-card input,
.workflow-action-card textarea {
    width: 100%;
    max-width: 520px;
}

.workflow-action-card label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.workflow-approve-card {
    border-left: 4px solid #16a34a;
}

@media (max-width: 720px) {
    .workflow-action-card {
        grid-template-columns: 1fr;
    }

    .workflow-action-card .btn {
        width: 100%;
    }
}

.orz-instruction-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafc;
}

.orz-instruction-options label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #dfe5ec;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
}

.orz-instruction-options input {
    flex: 0 0 auto;
    margin-top: 3px;
}

.orz-instruction-options span {
    overflow-wrap: anywhere;
}

.orz-instruction-empty {
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: #f8fafc;
}

.orz-instruction-list {
    margin: 0;
    padding-left: 22px;
}

.orz-instruction-list li + li {
    margin-top: 6px;
}

.orz-collapsible-card {
    padding: 0;
    overflow: hidden;
}

.orz-collapsible-card > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 84px;
    padding: 20px 24px;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.orz-collapsible-card > summary::-webkit-details-marker {
    display: none;
}

.orz-collapsible-card > summary span {
    min-width: 0;
}

.orz-collapsible-card > summary strong,
.orz-collapsible-card > summary small {
    display: block;
}

.orz-collapsible-card > summary strong {
    color: var(--text);
    font-size: 20px;
}

.orz-collapsible-card > summary small {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.orz-collapsible-card > summary::after {
    content: "+";
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: #f8fafc;
    font-size: 24px;
    line-height: 1;
}

.orz-collapsible-card[open] > summary::after {
    content: "\2212";
}

.orz-collapsible-card > summary:hover {
    background: #f8fafc;
}

.orz-collapsible-content {
    padding: 22px 24px 24px;
    border-top: 1px solid var(--line);
}
a { color: #ef6f17; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    background: rgba(255,255,255,0.96);
    color: #17212b;
    border-bottom: 1px solid #e7eaee;
    box-shadow: 0 1px 12px rgba(15, 23, 42, 0.05);
}
.topbar-inner {
    max-width: 1200px; margin: 0 auto; padding: 8px 20px;
    display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
}
.brand-logo:hover {
    background: #f3f4f6;
    text-decoration: none;
}
.brand-logo img {
    width: 32px;
    height: 34px;
    object-fit: contain;
    display: block;
}
.mainnav { display: flex; gap: 14px; flex-wrap: wrap; flex: 1; }
.nav-quick, .nav-full { display: contents; }
.nav-more { display: none; }
.mainnav a { color: #4b5563; font-size: 14px; padding: 7px 9px; border-radius: 6px; }
.mainnav a:hover { background: #f3f4f6; color: #ef6f17; text-decoration: none; }
.mainnav a.active { background: #fff1e8; color: #d95f12; }
.usermenu { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #6b7280; }
.usermenu a { color: #17212b; font-weight: 700; }
.usermenu a:hover { color: #ef6f17; }

.content { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }
.footer { text-align: center; padding: 20px; color: #9aa5b1; font-size: 12px; }

h1 { font-size: 22px; margin: 0 0 18px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; margin: 16px 0 8px; }

.card {
    background: #fff; border-radius: 8px; padding: 20px;
    border: 1px solid #eceff3;
    box-shadow: 0 10px 26px rgba(15,23,42,0.05); margin-bottom: 20px;
}

.grid-dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 24px; }
.dash-tile { background: #fff; border-radius: 8px; padding: 18px; border: 1px solid #eceff3; box-shadow: 0 10px 24px rgba(15,23,42,0.05); color: inherit; display: block; }
.dash-tile:hover { text-decoration: none; box-shadow: 0 14px 32px rgba(15,23,42,0.09); border-color: #ffd8c1; }
.dash-tile .num { font-size: 28px; font-weight: 700; }
.dash-tile .label { color: #616e7c; font-size: 13px; }
.dash-tile.alert .num { color: #d64545; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #e4e9ee; vertical-align: top; }
th { background: #f1f3f5; font-weight: 600; color: #3e4c59; }
.table-scroll { max-width: 100%; overflow-x: auto; padding-bottom: 8px; }
.table-scroll table { min-width: 980px; }
.table-scroll-wide table { min-width: 1720px; }
.table-scroll::-webkit-scrollbar { height: 10px; }
.table-scroll::-webkit-scrollbar-track { background: #eef2f6; border-radius: 999px; }
.table-scroll::-webkit-scrollbar-thumb { background: #a8b3c2; border-radius: 999px; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: #7b8794; }
.thumb-img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; border: 1px solid #d8e0e8; display: block; background: #eef2f6; }
.thumb-img:hover { opacity: 0.9; }
tr:hover td { background: #f9fbfd; }

.badge {
    display: inline-block; padding: 3px 9px; border-radius: 12px;
    font-size: 12px; font-weight: 600;
}
.status-wazne { background: #e3f7e8; color: #1a7a37; }
.status-zbliza-sie { background: #fff3d6; color: #9a6a00; }
.status-przeterminowane { background: #fde2e2; color: #b3261e; }
.status-brak { background: #e8eaed; color: #616e7c; }

.btn {
    display: inline-block; background: #ef6f17; color: #fff; border: none;
    padding: 9px 16px; border-radius: 6px; font-size: 14px; cursor: pointer;
}
.btn:hover { background: #d95f12; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-secondary { background: #e4e9ee; color: #1f2933; }
.btn-secondary:hover { background: #d3dae2; }
.btn-danger { background: #d64545; }
.btn-danger:hover { background: #b3261e; }

.actions { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

form.form-standard { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row label { font-size: 13px; font-weight: 600; color: #3e4c59; }
.form-row input, .form-row select, .form-row textarea {
    padding: 9px 10px; border: 1px solid #cbd2d9; border-radius: 6px; font-size: 14px; font-family: inherit;
}
.form-row-inline { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row-inline .form-row { flex: 1; min-width: 200px; }
.internal-form-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 20px; }
.internal-form-columns .form-standard { max-width: none; padding: 16px; border: 1px solid #e4e9ee; border-radius: 8px; }
.internal-form-columns h3 { margin-top: 0; }
.internal-wide-form { max-width: 960px !important; margin-top: 18px; }
.internal-placeholder { min-height: 220px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.internal-dashboard-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 20px; }

.form-inline-upload { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.inline-status-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.inline-status-form select { padding: 5px 8px; border: 1px solid #cbd2d9; border-radius: 6px; font-size: 13px; }

.zalaczniki-box { background: #f7f9fb; border-radius: 6px; padding: 14px; margin-top: 16px; }
.zalaczniki-lista { list-style: none; padding: 0; margin: 0; }
.zalaczniki-lista li { padding: 5px 0; font-size: 14px; }
.link-usun { color: #d64545; margin-left: 8px; font-size: 12px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 320px)); gap: 16px; align-items: start; }
.photo-item { border: 1px solid #e4e9ee; border-radius: 8px; padding: 10px; background: #fff; max-width: 320px; overflow: hidden; }
.photo-item a { display: block; width: 100%; overflow: hidden; border-radius: 6px; background: #eef2f6; }
.photo-item img { width: 100%; max-width: 100%; height: auto; max-height: 240px; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 6px; display: block; background: #eef2f6; }
.photo-item p { margin: 8px 0 0; font-size: 14px; }
.photo-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: #616e7c; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.flash-success { background: #e3f7e8; color: #1a7a37; }
.flash-error { background: #fde2e2; color: #b3261e; }

.text-muted { color: #8a94a3; font-size: 13px; }
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 18%, rgba(239,111,23,0.12), transparent 28%),
        linear-gradient(135deg, #f7f8fa 0%, #eef1f4 100%);
}
.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 460px);
    align-items: center;
    gap: 48px;
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 52px 0;
}
.login-visual {
    min-height: 520px;
    border-radius: 18px;
    background:
        radial-gradient(circle at 26% 24%, rgba(239,111,23,0.32), transparent 28%),
        linear-gradient(145deg, #132235 0%, #0d1827 100%);
    position: relative;
    overflow: hidden;
    box-shadow: 0 26px 70px rgba(15,23,42,0.18);
}
.login-visual::before {
    content: "";
    position: absolute;
    inset: auto -120px -90px -80px;
    height: 260px;
    background-image: radial-gradient(rgba(239,111,23,0.72) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: 0.35;
    transform: rotate(-6deg);
}
.login-visual-card {
    position: absolute;
    left: 42px;
    right: 42px;
    bottom: 42px;
    padding: 26px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    color: #fff;
    backdrop-filter: blur(10px);
}
.login-visual-card span {
    display: block;
    color: rgba(255,255,255,0.66);
    font-size: 14px;
    margin-bottom: 10px;
}
.login-visual-card strong {
    display: block;
    max-width: 420px;
    font-size: 30px;
    line-height: 1.18;
}
.login-wrap { max-width: 420px; width: 100%; margin: 0; }
.login-wrap .card { padding: 34px; }
.login-card {
    border-radius: 16px;
    box-shadow: 0 22px 60px rgba(15,23,42,0.12);
}
.login-logo {
    display: block;
    width: min(300px, 86%);
    height: auto;
    margin: 0 auto 30px;
    object-fit: contain;
}
.login-card .btn {
    width: 100%;
    min-height: 46px;
    font-weight: 700;
}

.readonly-note { background: #fff3d6; color: #9a6a00; padding: 8px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; display: inline-block; }

.module-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 18px;
}
.module-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
}
.module-tabs a:hover,
.module-tabs a.active {
    color: #d95f12;
    border-color: #ffd8c1;
    background: #fff1e8;
    text-decoration: none;
}
.orz-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 14px 0;
}
.orz-summary-grid > div {
    border: 1px solid #eceff3;
    border-radius: 8px;
    background: #f9fafb;
    padding: 12px;
}
.risk-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 10px;
    overflow: hidden;
}
.risk-item summary {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto minmax(180px, 280px);
    gap: 12px;
    align-items: center;
    padding: 12px 54px 12px 14px;
    cursor: pointer;
    background: #f9fafb;
    position: relative;
}
.risk-item summary::after {
    content: '+';
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e8edf3;
    color: #17283d;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
}
.risk-item[open] summary::after {
    content: '\2212';
    background: #fff0e7;
    color: #d95f12;
}
.risk-item[open] summary {
    border-bottom: 1px solid #e5e7eb;
}
.orz-readonly-note {
    margin: 12px 0 16px;
    padding: 12px 14px;
    border: 1px solid #f4c7aa;
    border-radius: 6px;
    background: #fff7f1;
    color: #56321d;
}
.orz-readonly-note a {
    color: #b94708;
    font-weight: 700;
}
.risk-form {
    max-width: none !important;
    padding: 14px;
}
.risk-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.risk-low {
    background: #e3f7e8;
    color: #1a7a37;
}
.risk-medium {
    background: #fff3d6;
    color: #9a6a00;
}
.risk-high {
    background: #fde2e2;
    color: #b3261e;
}
.risk-calculation-preview {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
}
.risk-preview-note {
    color: #4b5563;
    font-size: 12px;
    line-height: 1.35;
}
.hazard-form-actions {
    justify-content: flex-end;
    margin: 2px 0 0;
}
.hazard-manual-cta {
    margin: 0;
}
.table-primary-link {
    color: #d95f12;
    font-weight: 700;
}
.hazard-save-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border: 1px solid #ffd2b5;
    border-radius: 6px;
    background: #fff7f0;
}
.hazard-save-option input {
    margin-top: 3px;
}
.hazard-save-option span,
.hazard-save-option small {
    display: block;
}
.hazard-save-option small {
    margin-top: 3px;
    color: #616e7c;
    font-weight: 400;
}

@media (max-width: 700px) {
    .topbar-inner {
        padding: 8px 12px 10px;
        gap: 8px;
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
    }
    .brand-logo {
        width: 40px;
        height: 40px;
    }
    .usermenu {
        justify-content: flex-end;
        gap: 8px;
        min-width: 0;
        font-size: 12px;
    }
    .usermenu span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 170px;
    }
    .mainnav {
        grid-column: 1 / -1;
        order: 3;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
        align-items: start;
        overflow: visible;
        padding: 4px 0 0;
    }
    .nav-quick {
        display: grid;
        grid-template-columns: minmax(80px, auto) minmax(118px, auto);
        gap: 6px;
        min-width: 0;
    }
    .nav-full {
        display: none;
    }
    .nav-more {
        display: block;
        position: relative;
        justify-self: end;
    }
    .nav-more summary {
        list-style: none;
        color: #17212b;
        background: #f3f4f6;
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        min-width: 58px;
        min-height: 34px;
        padding: 8px 10px;
        font-size: 13px;
        line-height: 1.2;
        font-weight: 700;
        cursor: pointer;
        text-align: center;
    }
    .nav-more summary::-webkit-details-marker {
        display: none;
    }
    .nav-more summary.active {
        background: #fff1e8;
        border-color: #ffd8c1;
        color: #d95f12;
    }
    .nav-more[open] summary {
        background: #ef6f17;
        border-color: #ef6f17;
        color: #fff;
    }
    .nav-more-list {
        position: absolute;
        right: 0;
        top: calc(100% + 8px);
        z-index: 20;
        width: min(86vw, 340px);
        display: grid;
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 8px;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 10px 28px rgba(15,41,66,0.24);
    }
    .nav-more-list a {
        color: #1f2933;
        background: transparent;
        border-radius: 6px;
        padding: 10px 12px;
    }
    .nav-more-list a:hover {
        background: #eef2f6;
    }
    .nav-more-list a.active {
        background: #ef6f17;
        color: #fff;
    }
    .mainnav a {
        min-width: 0;
        font-size: 13px;
        line-height: 1.2;
        padding: 9px 10px;
        text-align: center;
        white-space: normal;
    }
    .content {
        padding: 18px 12px 50px;
    }
    h1 {
        font-size: 20px;
        margin-bottom: 12px;
    }
    .card {
        padding: 16px;
        border-radius: 8px;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .card table {
        min-width: 760px;
    }
    .card .table-scroll {
        overflow-x: visible;
        padding-bottom: 0;
    }
    .card .table-scroll table {
        min-width: 760px;
    }
    .card .table-scroll-wide table {
        min-width: 1500px;
    }
    .module-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 6px;
    }
    .module-tabs a {
        white-space: nowrap;
    }
    .risk-item summary {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

@media (max-width: 860px) {
    .login-shell {
        display: block;
        width: min(460px, calc(100% - 28px));
        padding: 34px 0;
    }
    .login-visual {
        display: none;
    }
    .login-wrap {
        max-width: none;
    }
    .login-wrap .card {
        padding: 28px 22px;
    }
}

/* ---------------------------------------------------------------------
   Secure BHP 2026 dashboard layout
   ------------------------------------------------------------------ */
:root {
    --brand: #f97316;
    --brand-dark: #ea580c;
    --navy: #07182b;
    --navy-2: #0b1f33;
    --surface: #ffffff;
    --page: #f5f7fa;
    --line: #e5e7eb;
    --text: #0f172a;
    --muted: #64748b;
    --red: #dc2626;
    --red-bg: #fee2e2;
    --amber: #f59e0b;
    --amber-bg: #fef3c7;
    --green: #16a34a;
    --green-bg: #dcfce7;
    --blue: #2563eb;
    --blue-bg: #dbeafe;
}

body {
    background: var(--page);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(249, 115, 22, .35);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[hidden] {
    display: none !important;
}

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--navy), #061323);
    color: #e5edf7;
    border-right: 1px solid rgba(255,255,255,.08);
    z-index: 40;
}

.sidebar-brand {
    padding: 20px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
}

.sidebar-logo:hover,
.sidebar-item:hover {
    text-decoration: none;
}

.sidebar-logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.sidebar-nav {
    padding: 12px 12px 18px;
    flex: 1;
}

.sidebar-section {
    margin-bottom: 18px;
}

.sidebar-heading {
    padding: 10px 8px 8px;
    color: #91a3b8;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sidebar-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    width: 100%;
    background: transparent;
    color: #eaf0f8;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
}

.sidebar-item:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.sidebar-item.active {
    background: rgba(255,255,255,.1);
    color: var(--brand);
}

.sidebar-item.is-locked {
    color: rgba(234,240,248,.54);
}

.sidebar-lock {
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.1);
    color: #fed7aa;
    font-size: 10px;
    font-weight: 800;
}

.sidebar-item.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 999px;
    background: var(--brand);
}

.sidebar-bottom {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.12);
}

.app-shell.sidebar-collapsed {
    grid-template-columns: 78px minmax(0, 1fr);
}

.sidebar-collapsed .sidebar-logo span,
.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-heading {
    display: none;
}

.sidebar-collapsed .sidebar-brand {
    padding-inline: 14px;
}

.sidebar-collapsed .sidebar-item {
    justify-content: center;
    padding-inline: 10px;
}

.sidebar-collapsed .sidebar-item.active::before {
    left: -12px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 68px;
    display: grid;
    grid-template-columns: auto minmax(170px, max-content) minmax(260px, 1fr) auto auto;
    align-items: center;
    gap: 18px;
    padding: 12px 28px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 10px rgba(15,23,42,.04);
    backdrop-filter: blur(10px);
}

.mobile-menu-button {
    display: none;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    width: 42px;
    height: 42px;
    color: var(--text);
}

.company-switcher,
.global-search,
.notification-button,
.profile-menu summary {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    min-height: 42px;
}

.company-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    color: #334155;
    font-size: 14px;
    white-space: nowrap;
}

.company-switcher .icon {
    width: 16px;
    height: 16px;
    color: #475569;
}

.company-switcher select {
    max-width: 210px;
    border: 0;
    background: transparent;
    color: #0f172a;
    font: inherit;
    font-weight: 750;
    outline: 0;
    appearance: none;
}

.company-switcher input[type="hidden"] {
    display: none;
}

.global-search {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 620px;
    padding: 0 14px;
    color: #64748b;
}

.global-search input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    font: inherit;
    color: var(--text);
    background: transparent;
}

.notification-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    color: #0f172a;
}

.notification-count {
    position: absolute;
    right: -7px;
    top: -7px;
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.profile-menu {
    position: relative;
}

.profile-menu summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    cursor: pointer;
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.avatar {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #e2e8f0;
    color: #1e293b;
    font-size: 12px;
    font-weight: 800;
}

.profile-name {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.profile-menu .icon {
    width: 16px;
    height: 16px;
}

.profile-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 190px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15,23,42,.16);
}

.profile-dropdown a,
.profile-role {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 7px;
    color: #1e293b;
    font-size: 14px;
}

.profile-role {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.profile-dropdown a:hover {
    background: #f8fafc;
    color: var(--brand-dark);
    text-decoration: none;
}

.content {
    max-width: none;
    padding: 24px 32px 48px;
}

.content h1 {
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: 0;
    margin: 0 0 6px;
}

.page-subtitle {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 15px;
}

.card,
.dash-tile {
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: 0 8px 28px rgba(15,23,42,.06);
}

.dashboard-grid {
    display: grid;
    gap: 18px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.task-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.kpi-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    align-items: center;
    padding: 22px;
    min-height: 126px;
    color: inherit;
}

.kpi-card:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 14px 36px rgba(15,23,42,.1);
}

.kpi-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 999px;
}

.kpi-icon .icon {
    width: 30px;
    height: 30px;
}

.kpi-number {
    font-size: 36px;
    line-height: 1;
    font-weight: 800;
}

.kpi-label {
    margin-top: 7px;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.kpi-note {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

.tone-red { color: var(--red); }
.tone-red .kpi-icon { background: var(--red-bg); }
.tone-amber { color: var(--amber); }
.tone-amber .kpi-icon { background: var(--amber-bg); }
.tone-blue { color: var(--blue); }
.tone-blue .kpi-icon { background: var(--blue-bg); }
.tone-green { color: var(--green); }
.tone-green .kpi-icon { background: var(--green-bg); }

.dashboard-two-col {
    display: grid;
    grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr);
    gap: 18px;
}

.dashboard-single-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: minmax(320px, .95fr) minmax(420px, 1.05fr);
    gap: 18px;
}

.section-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 8px 28px rgba(15,23,42,.06);
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.section-header h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.section-header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.section-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 10px;
}

.quick-action {
    min-width: 0;
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid rgba(249,115,22,.36);
    border-radius: 8px;
    color: #9a3412;
    background: #fff7ed;
    font-weight: 750;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
}

.quick-action:hover {
    background: #ffedd5;
    text-decoration: none;
}

button.quick-action {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
}

.quick-action.is-locked {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 5px 8px;
}

.quick-action-label {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.quick-action-plus {
    color: var(--brand-dark);
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
}

.quick-action-plan {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    background: #ffedd5;
    color: #9a3412;
    font-size: 10px;
    font-weight: 800;
}

.modal-open {
    overflow: hidden;
}

.upgrade-modal[hidden] {
    display: none;
}

.upgrade-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
}

.upgrade-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 16, 35, .66);
    backdrop-filter: blur(3px);
}

.upgrade-modal-dialog {
    position: relative;
    width: min(520px, 100%);
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(2, 16, 35, .28);
    text-align: center;
}

.upgrade-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: #334155;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.upgrade-modal-icon,
.upgrade-page-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border-radius: 8px;
    background: #fff1e8;
    color: var(--brand);
}

.upgrade-modal-icon .icon,
.upgrade-page-icon .icon {
    width: 28px;
    height: 28px;
}

.upgrade-eyebrow {
    margin: 0 0 8px;
    color: #c2410c;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.upgrade-modal-dialog h2 {
    margin: 0 0 12px;
    font-size: 25px;
}

.upgrade-modal-dialog > p:not(.upgrade-eyebrow) {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.upgrade-modal-actions,
.upgrade-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.upgrade-modal-later {
    margin-top: 15px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
}

.upgrade-page {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.upgrade-page-main {
    padding: clamp(28px, 5vw, 64px);
    text-align: center;
}

.upgrade-page-main h1 {
    margin: 0 0 14px;
    font-size: clamp(28px, 4vw, 42px);
}

.upgrade-lead {
    max-width: 680px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
}

.upgrade-package-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.upgrade-package-row span {
    padding: 9px 12px;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    background: #fff7ed;
    color: #7c2d12;
    font-size: 13px;
}

.upgrade-back {
    display: inline-flex;
    align-items: center;
    padding: 10px 4px;
    color: var(--muted);
    font-weight: 700;
}

.upgrade-benefits {
    padding: clamp(28px, 4vw, 48px);
    background: #071b2f;
    color: #fff;
}

.upgrade-benefits-title {
    margin: 0 0 22px;
    font-size: 19px;
    font-weight: 800;
}

.upgrade-benefits ul {
    display: grid;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.upgrade-benefits li {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: start;
    line-height: 1.45;
}

.upgrade-benefits li span {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(34, 197, 94, .16);
    color: #4ade80;
    font-weight: 900;
}

.upgrade-note {
    margin: 28px 0 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .14);
    color: #b9c6d4;
    font-size: 13px;
    line-height: 1.55;
}

.feature-inline-upgrade {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-color: #fed7aa;
    background: #fffaf5;
}

.feature-inline-upgrade h2 {
    margin-top: 0;
}

.feature-inline-upgrade p {
    margin-bottom: 0;
}

.compliance-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    text-align: center;
}

.progress-ring {
    --value: 0%;
    --ring-color: var(--green);
    width: 74px;
    height: 74px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 9px;
    border-radius: 999px;
    background: conic-gradient(var(--ring-color) var(--value), #e5e7eb 0);
}

.progress-ring::before {
    content: "";
    position: absolute;
}

.progress-ring span {
    width: 58px;
    height: 58px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    font-weight: 800;
    font-size: 14px;
}

.progress-ring.is-empty {
    background: #e5e7eb;
}

.compliance-label {
    display: block;
    color: #1e293b;
    font-weight: 700;
    font-size: 13px;
}

.attention-card {
    padding: 0;
    overflow: hidden;
}

.attention-card .section-header {
    padding: 18px 18px 0;
}

.attention-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.attention-table th,
.attention-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #edf1f5;
}

.attention-table th {
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    text-transform: none;
}

.badge-priority-high,
.badge-priority-medium,
.badge-priority-low,
.badge-status-overdue,
.badge-status-progress,
.badge-status-planned,
.badge-status-done {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge-priority-high,
.badge-status-overdue { background: var(--red-bg); color: var(--red); }
.badge-priority-medium,
.badge-status-progress { background: var(--amber-bg); color: #d97706; }
.badge-priority-low,
.badge-status-done { background: var(--green-bg); color: var(--green); }
.badge-status-planned { background: var(--blue-bg); color: var(--blue); }

.action-menu {
    position: relative;
}

.action-menu summary {
    list-style: none;
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    cursor: pointer;
}

.action-menu summary::-webkit-details-marker { display: none; }
.action-menu summary:hover { background: #f1f5f9; }

.action-menu div {
    position: absolute;
    right: 0;
    z-index: 10;
    min-width: 170px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(15,23,42,.14);
}

.action-menu a {
    display: block;
    padding: 8px 9px;
    border-radius: 7px;
    color: #1e293b;
    font-size: 13px;
    font-weight: 700;
}

.action-menu a:hover {
    background: #f8fafc;
    color: var(--brand-dark);
    text-decoration: none;
}

.deadline-list,
.activity-list,
.search-results {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.deadline-item,
.activity-item,
.search-result {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.item-icon {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--blue);
}

.item-icon .icon {
    width: 18px;
    height: 18px;
}

.item-title {
    margin: 0;
    color: #1e293b;
    font-weight: 750;
    font-size: 14px;
}

.item-meta {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.days-pill {
    border-radius: 999px;
    background: #ffedd5;
    color: var(--brand-dark);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 18px;
    color: var(--muted);
    background: #f8fafc;
}

.search-card {
    margin-bottom: 18px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumbs a {
    color: #475569;
    font-weight: 700;
}

.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}

.table-toolbar input {
    width: min(360px, 100%);
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    font: inherit;
}

.table-count {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.calendar-weekday {
    padding: 10px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.calendar-day {
    min-height: 132px;
    padding: 10px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.calendar-day.is-muted {
    background: #f8fafc;
}

.calendar-day.is-today {
    box-shadow: inset 0 0 0 2px rgba(249,115,22,.38);
}

.calendar-day strong {
    display: block;
    margin-bottom: 8px;
}

.calendar-event {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 5px 0;
    padding: 5px 7px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 750;
}

.calendar-event.is-overdue {
    background: var(--red-bg);
    color: var(--red);
}

.calendar-event.is-upcoming {
    background: var(--blue-bg);
    color: var(--blue);
}

.calendar-more {
    color: var(--muted);
    font-size: 12px;
}

.report-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.report-tabs a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 750;
}

.report-tabs a.active,
.report-tabs a:hover {
    background: #fff7ed;
    border-color: #fed7aa;
    color: var(--brand-dark);
    text-decoration: none;
}

.employee-profile {
    margin-bottom: 18px;
}

.employee-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 16px;
}

.employee-profile-header h2 {
    margin: 0 0 5px;
    font-size: 24px;
}

.employee-profile-header p {
    margin: 0;
    color: var(--muted);
}

.employee-profile-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.employee-profile-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.employee-profile-meta span,
.profile-status-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.employee-profile-meta span {
    padding: 10px 12px;
    color: #334155;
    font-size: 13px;
}

.profile-status-grid,
.profile-history-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.profile-status-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-status-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    box-shadow: none;
}

.profile-status-card h3 {
    margin: 0 0 4px;
    font-size: 15px;
}

.profile-status-card p {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 13px;
}

.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.package-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100%;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.package-card.is-featured {
    border-color: #fed7aa;
    box-shadow: inset 0 3px 0 var(--brand);
}

.package-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.package-card h3 {
    margin: 0 0 2px;
    font-size: 18px;
}

.package-badge {
    background: #fff7ed;
    color: var(--brand-dark);
    white-space: nowrap;
}

.package-description {
    min-height: 54px;
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.45;
}

.package-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-top: 4px;
}

.package-price strong {
    font-size: 26px;
    line-height: 1;
    color: #0f172a;
}

.package-price span,
.package-annual {
    color: var(--muted);
    font-size: 13px;
}

.package-annual {
    margin: -4px 0 0;
}

.package-limits {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.package-limits div {
    padding: 9px 10px;
    border: 1px solid #eef2f6;
    border-radius: 8px;
    background: #f8fafc;
}

.package-limits dt {
    color: var(--muted);
    font-size: 12px;
}

.package-limits dd {
    margin: 3px 0 0;
    color: #0f172a;
    font-weight: 800;
}

.package-feature-list {
    margin: 0;
    padding-left: 18px;
    color: #334155;
    font-size: 13px;
    line-height: 1.55;
    flex: 1;
}

.company-logo-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.company-logo-preview img {
    max-width: 150px;
    max-height: 70px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px;
}

.package-locked-page {
    max-width: 760px;
}

.orz-team-form,
.orz-team-editor {
    max-width: 980px;
}

.orz-team-labels,
.orz-team-row {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(280px, 1.2fr) 42px;
    gap: 10px;
    align-items: center;
}

.orz-team-labels {
    margin-bottom: 7px;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.orz-team-rows {
    display: grid;
    gap: 9px;
}

.orz-team-row input {
    width: 100%;
}

.orz-team-remove {
    width: 42px;
    height: 42px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fff;
    color: #b91c1c;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.orz-team-remove:hover:not(:disabled) {
    background: #fef2f2;
}

.orz-team-remove:disabled {
    cursor: not-allowed;
    opacity: .35;
}

.orz-team-add {
    margin-top: 10px;
}

.orz-approver-row {
    margin-top: 20px;
}

.orz-team-table {
    max-width: 900px;
}

.bio-entry-panel {
    max-width: 1180px;
}

.bio-korz-info {
    margin: 4px 0 14px;
    padding: 10px 12px;
    border-left: 3px solid var(--accent);
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
    font-weight: 700;
}

.bio-hazard-fieldset {
    margin: 0 0 18px;
    padding: 0;
    border: 0;
}

.bio-hazard-fieldset legend {
    margin-bottom: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.bio-hazard-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.bio-hazard-option {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-height: 76px;
    padding: 13px;
    border: 1px solid #d9e1ea;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}

.bio-hazard-option:hover {
    border-color: #f6a46a;
    background: #fffaf7;
}

.bio-hazard-option input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
}

.bio-hazard-option strong,
.bio-hazard-option small {
    display: block;
}

.bio-hazard-option small {
    margin-top: 5px;
    color: #64748b;
    line-height: 1.4;
}

.bio-error {
    color: #b91c1c;
    background: #fff1f2;
}

.bio-approval-bar {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.bio-approval-bar label {
    display: grid;
    gap: 6px;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.bio-work-table {
    min-width: 1180px;
    table-layout: fixed;
}

.bio-work-table th:nth-child(1) { width: 48px; }
.bio-work-table th:nth-child(2) { width: 170px; }
.bio-work-table th:nth-child(3) { width: 160px; }
.bio-work-table th:nth-child(4) { width: 390px; }
.bio-work-table th:nth-child(5) { width: 120px; }
.bio-work-table th:nth-child(6) { width: 260px; }
.bio-work-table textarea,
.bio-work-table select {
    width: 100%;
}

.bio-work-edit {
    margin: 0;
}

.inline-form {
    display: inline;
}

.link-button {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
}

.danger-link {
    color: #c81e1e;
}

.bio-legacy summary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
}

.bio-legacy summary span {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

@media (max-width: 1199px) {
    .app-shell {
        grid-template-columns: 78px minmax(0, 1fr);
    }
    .sidebar-logo span,
    .sidebar-label,
    .sidebar-heading {
        display: none;
    }
    .sidebar-brand {
        padding-inline: 14px;
    }
    .sidebar-item {
        justify-content: center;
        padding-inline: 10px;
    }
    .kpi-grid,
    .compliance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-two-col,
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .app-shell,
    .app-shell.sidebar-collapsed {
        display: block;
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 264px;
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .mobile-sidebar-open .sidebar {
        transform: translateX(0);
    }
    .sidebar-logo span,
    .sidebar-label,
    .sidebar-heading {
        display: inline;
    }
    .sidebar-item {
        justify-content: flex-start;
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 35;
        background: rgba(15,23,42,.45);
    }
    .topbar {
        grid-template-columns: auto 1fr auto;
        gap: 10px;
        padding: 10px 12px;
    }
    .mobile-menu-button {
        display: inline-grid;
        place-items: center;
    }
    .company-switcher {
        min-width: 0;
        justify-content: center;
    }
    .company-switcher select {
        max-width: 130px;
    }
    .global-search {
        grid-column: 1 / -1;
        order: 5;
        max-width: none;
    }
    .notification-button {
        display: none;
    }
    .profile-name {
        display: none;
    }
    .content {
        padding: 18px 12px 40px;
    }
    .page-header-row,
    .table-toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }
    .calendar-grid {
        display: block;
        border: 0;
        background: transparent;
    }
    .calendar-weekday,
    .calendar-day.is-muted {
        display: none;
    }
    .calendar-day {
        min-height: 0;
        margin-bottom: 10px;
        border: 1px solid var(--line);
        border-radius: 10px;
    }
    .content h1 {
        font-size: 24px;
    }
    .kpi-grid,
    .compliance-grid {
        grid-template-columns: 1fr;
    }
    .quick-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .upgrade-page {
        grid-template-columns: 1fr;
    }
    .upgrade-modal-dialog {
        padding: 30px 20px 24px;
    }
    .upgrade-modal-actions,
    .upgrade-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .feature-inline-upgrade {
        align-items: stretch;
        flex-direction: column;
    }
    .employee-profile-header,
    .employee-profile-actions {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }
    .employee-profile-meta,
    .profile-status-grid,
    .profile-history-grid {
        grid-template-columns: 1fr;
    }
    .section-card {
        padding: 16px;
    }
    .orz-team-labels {
        display: none;
    }
    .orz-team-row {
        grid-template-columns: 1fr 42px;
    }
    .orz-team-row input:first-child {
        grid-column: 1 / -1;
    }
    .attention-card {
        overflow-x: auto;
    }
    .bio-hazard-options {
        grid-template-columns: 1fr;
    }
    .bio-approval-bar {
        align-items: stretch;
        flex-direction: column;
    }
    .attention-table {
        min-width: 860px;
    }
}
/* Checklisty kontroli */
.checklist-page-header,
.section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}
.checklist-page-header { margin-bottom: 18px; }
.checklist-page-header h1 { margin-bottom: 4px; }
.checklist-header-actions,
.checklist-close-card .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.checklist-workspace-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 18px;
    border-bottom: 1px solid #dce3ea;
}
.checklist-workspace-nav a {
    color: #526176;
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 3px solid transparent;
}
.checklist-workspace-nav a.active { color: #c94f08; border-color: #f97316; }
.checklist-sync-status { margin-left: auto; color: #637083; font-size: 13px; }
.sync-dot { display: inline-block; width: 8px; height: 8px; background: #16a34a; border-radius: 50%; margin-right: 6px; }
.checklist-scope-template { padding: 18px 0; border-top: 1px solid #e3e8ee; }
.checklist-scope-template:first-of-type { border-top: 0; }
.checklist-template-title { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.checklist-template-title h3 { margin: 0 0 2px; }
.checklist-template-title span { color: #6b7788; font-size: 13px; }
.scope-section-preview { border-top: 1px solid #edf0f3; }
.scope-section-preview > summary { list-style: none; cursor: pointer; }
.scope-section-preview > summary::-webkit-details-marker { display: none; }
.scope-section-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    cursor: pointer;
    padding: 4px 36px 4px 0;
    position: relative;
}
.scope-section-toggle::after { content: "+"; position: absolute; right: 8px; font-size: 20px; color: #64748b; }
.scope-section-preview[open] .scope-section-toggle::after { content: "−"; }
.scope-section-toggle input { width: 20px; height: 20px; flex: 0 0 auto; }
.scope-section-toggle span { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; }
.scope-section-toggle small { color: #738095; white-space: nowrap; }
.scope-section-preview.has-duplicate strong { color: #9a3412; }
.scope-question-list { margin: 0 0 12px 44px; padding: 4px 20px 4px 22px; color: #415168; }
.scope-question-list li { margin: 8px 0; padding-left: 5px; }
.scope-question-list li span { display: inline-block; min-width: 42px; color: #b94708; font-weight: 800; }
.checklist-template-grid { border-top: 1px solid #e3e8ee; margin: 16px 0; }
.checklist-template-choice { border-bottom: 1px solid #e3e8ee; }
.checklist-template-option {
    display: grid;
    grid-template-columns: 28px 90px minmax(220px, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    cursor: pointer;
}
.checklist-template-option input { width: 20px; height: 20px; }
.checklist-template-option strong { display: block; }
.checklist-template-option p { grid-column: 3 / -1; margin: -5px 0 0; color: #657287; font-size: 14px; }
.checklist-template-option small,
.checklist-template-option em { color: #657287; }
.checklist-template-choice.is-attached { opacity: .62; }
.checklist-template-preview { margin: -4px 0 14px 130px; }
.checklist-template-preview > summary { color: #b94708; cursor: pointer; font-weight: 700; }
.template-preview-section { margin: 12px 0; padding: 12px 14px; background: #f7f9fb; border-left: 3px solid #f97316; }
.template-preview-section ol { margin: 8px 0 0; padding-left: 22px; color: #4c5d73; }
.template-preview-section li { margin: 6px 0; }
.template-kind { color: #9a3e0a; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.checklist-progress-card {
    background: #fff;
    border: 1px solid #dfe5eb;
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}
.checklist-progress-copy { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.checklist-progress-copy span { color: #68768a; }
.checklist-progress-track { height: 8px; background: #e7ebef; overflow: hidden; }
.checklist-progress-track span { display: block; height: 100%; background: #f97316; transition: width .2s ease; }
.checklist-summary-pills { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; color: #657287; font-size: 13px; }
.checklist-summary-pills .is-ok b { color: #15803d; }
.checklist-summary-pills .is-bad b { color: #dc2626; }
.checklist-recommendations-overview { padding: 0; overflow: hidden; }
.checklist-recommendations-overview > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; cursor: pointer; list-style: none; }
.checklist-recommendations-overview > summary::-webkit-details-marker { display: none; }
.checklist-recommendations-overview > summary span strong,
.checklist-recommendations-overview > summary span small { display: block; }
.checklist-recommendations-overview > summary span small { color: #718096; margin-top: 3px; }
.checklist-recommendations-overview > summary > b { min-width: 30px; height: 30px; display: grid; place-items: center; background: #fff1e8; color: #b94708; border-radius: 50%; }
.checklist-overview-body { padding: 0 20px 18px; }
.checklist-overview-recommendation { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 13px 0; border-top: 1px solid #e5e9ee; }
.checklist-overview-recommendation div span { display: block; color: #b94708; font-size: 12px; font-weight: 800; }
.checklist-overview-recommendation div strong { display: block; margin-top: 3px; }
.checklist-overview-recommendation p { margin: 0; color: #66758a; font-size: 13px; }
.checklist-overview-recommendation a { font-weight: 700; white-space: nowrap; }
.checklist-filterbar { display: flex; gap: 4px; margin: 18px 0 10px; }
.checklist-filterbar button {
    border: 1px solid #d7dee6;
    background: #fff;
    color: #405067;
    padding: 8px 12px;
    cursor: pointer;
}
.checklist-filterbar button.active { border-color: #f97316; color: #b94708; background: #fff7ed; }
.checklist-run-section { background: #fff; border: 1px solid #dfe5eb; margin-bottom: 12px; }
.checklist-run-section > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
}
.checklist-run-section > summary::-webkit-details-marker { display: none; }
.checklist-run-section > summary small { display: block; color: #778398; margin-bottom: 3px; }
.checklist-run-section > summary strong { font-size: 18px; }
.checklist-run-section > summary b { color: #6a7688; font-size: 13px; }
.checklist-run-items { background: #f5f7f9; padding: 12px; }
.checklist-item-card {
    background: #fff;
    border: 1px solid #dfe5eb;
    border-left: 4px solid #cbd5df;
    margin-bottom: 10px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .035);
}
.checklist-item-card:last-child { margin-bottom: 0; }
.checklist-item-card.is-answered { border-left-color: #22c55e; }
.checklist-item-card.is-noncompliant { border-left-color: #ef4444; }
.checklist-item-card > summary { list-style: none; cursor: pointer; }
.checklist-item-card > summary::-webkit-details-marker { display: none; }
.checklist-item-question { display: flex; gap: 12px; align-items: flex-start; padding: 16px; }
.checklist-item-question > span { color: #c94f08; font-weight: 800; min-width: 32px; }
.checklist-item-question > div { flex: 1 1 auto; min-width: 0; }
.checklist-item-question > b { flex: 0 0 auto; color: #607087; font-size: 12px; font-weight: 700; }
.checklist-item-question strong { display: block; line-height: 1.42; }
.checklist-item-question small { display: block; color: #6a7688; margin-top: 5px; }
.checklist-item-body { padding: 0 16px 16px; }
.checklist-answer-control { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 520px; margin: 16px 0 12px; }
.checklist-answer-control button {
    min-height: 44px;
    border: 1px solid #cad3dd;
    background: #fff;
    color: #34445a;
    font-weight: 700;
    cursor: pointer;
}
.checklist-answer-control button + button { border-left: 0; }
.checklist-answer-control button.selected { background: #0f2438; color: #fff; border-color: #0f2438; }
.checklist-answer-control button[data-answer-value="nie"].selected,
.checklist-answer-control button[data-answer-value="niezgodne"].selected { background: #dc2626; border-color: #dc2626; }
.checklist-field { display: block; margin-top: 12px; }
.checklist-field > span { display: block; color: #526176; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.checklist-field textarea { width: 100%; resize: vertical; }
.checklist-item-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 12px; color: #6b7788; font-size: 13px; }
.checklist-photo-button { display: inline-flex; align-items: center; cursor: pointer; color: #b94708; font-weight: 700; }
.checklist-photo-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.checklist-photo-button.disabled { opacity: .5; cursor: default; }
.checklist-save-state { margin-left: auto; }
.checklist-save-state.is-saving { color: #b45309; }
.checklist-save-state.is-saved { color: #15803d; }
.checklist-save-state.is-error { color: #dc2626; font-weight: 700; }
.checklist-photo-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.checklist-photo-preview img { width: 78px; height: 62px; object-fit: cover; border: 1px solid #d5dce4; }
.checklist-recommendation-panel { display: none; margin-top: 14px; padding: 14px 0 0; border-top: 1px solid #fecaca; }
.checklist-recommendation-panel.is-visible { display: block; }
.checklist-recommendation-panel h4 { margin: 0 0 10px; color: #b91c1c; }
.checklist-recommendation-panel > textarea { width: 100%; min-height: 150px; line-height: 1.45; }
.checklist-rec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.checklist-rec-grid label { color: #526176; font-size: 13px; font-weight: 700; }
.checklist-rec-grid input,
.checklist-rec-grid select { width: 100%; margin-top: 4px; }
.success-note { color: #15803d; font-size: 13px; }
.saved-recommendation-card { margin: 12px 0; border: 1px solid #dce3ea; background: #fff; }
.saved-recommendation-card > summary { display: flex; justify-content: space-between; gap: 14px; padding: 12px 14px; cursor: pointer; list-style: none; }
.saved-recommendation-card > summary::-webkit-details-marker { display: none; }
.saved-recommendation-card > summary span strong,
.saved-recommendation-card > summary span small { display: block; }
.saved-recommendation-card > summary span small { margin-top: 5px; color: #68768a; }
.saved-recommendation-card > summary > b { color: #b94708; white-space: nowrap; }
.saved-recommendation-form { padding: 14px; border-top: 1px solid #e5e9ee; }
.saved-recommendation-form > label { display: block; color: #526176; font-size: 13px; font-weight: 700; }
.saved-recommendation-form textarea { width: 100%; min-height: 150px; margin-top: 5px; }
.checklist-finish-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.checklist-finish-actions form { margin: 0; }
.empty-state { padding: 24px; border: 1px dashed #cad3dd; color: #66758a; }
.icon-text-button { border: 0; background: transparent; cursor: pointer; font: inherit; }

@media (max-width: 767px) {
    .checklist-page-header,
    .section-heading-row { display: block; }
    .checklist-header-actions { margin-top: 12px; }
    .checklist-header-actions .btn { flex: 1 1 auto; text-align: center; }
    .checklist-workspace-nav { overflow-x: auto; }
    .checklist-workspace-nav a { white-space: nowrap; padding: 10px; }
    .checklist-sync-status { display: none; }
    .checklist-template-option { grid-template-columns: 26px 1fr; }
    .checklist-template-option .template-kind { grid-column: 2; }
    .checklist-template-option strong,
    .checklist-template-option small,
    .checklist-template-option p,
    .checklist-template-option em { grid-column: 2; }
    .checklist-template-preview { margin-left: 38px; }
    .checklist-progress-card { position: sticky; top: 0; z-index: 5; padding: 12px; }
    .checklist-filterbar { overflow-x: auto; }
    .checklist-filterbar button { white-space: nowrap; }
    .checklist-run-section > summary { padding: 14px; }
    .checklist-run-items { padding: 7px; }
    .checklist-item-question { padding: 14px 12px; }
    .checklist-item-body { padding: 0 12px 14px; }
    .checklist-item-question > b { max-width: 92px; text-align: right; }
    .checklist-answer-control { max-width: none; }
    .checklist-answer-control button { min-height: 50px; }
    .checklist-rec-grid { grid-template-columns: 1fr; }
    .checklist-save-state { width: 100%; margin-left: 0; }
    .checklist-overview-recommendation { grid-template-columns: 1fr; gap: 6px; }
    .checklist-finish-actions { display: grid; grid-template-columns: 1fr; }
    .checklist-finish-actions .btn,
    .checklist-finish-actions form,
    .checklist-finish-actions button { width: 100%; text-align: center; }
}
.checklist-library-list > article {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 18px 0;
    border-top: 1px solid #e3e8ee;
}
.control-checklist-inline-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #e3e8ee; color: #657287; }
.control-checklist-inline-summary a { margin-left: auto; font-weight: 700; }

/* Obieg realizacji zaleceń pokontrolnych */
.recommendation-page-header { align-items: flex-start; }
.recommendation-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.recommendation-focus-card,
.recommendation-action-card,
.recommendation-review-card,
.recommendation-list-card,
.recommendation-collapsible { margin-bottom: 16px; }
.recommendation-focus-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding: 20px; }
.recommendation-focus-heading h2 { margin: 9px 0 0; max-width: 1000px; font-size: 22px; }
.task-priority { display: inline-block; padding: 4px 9px; border-radius: 999px; background: #eef2f7; color: #526176; font-size: 12px; font-weight: 800; }
.task-priority.priority-wysoki,
.task-priority.priority-pilne { background: #fee2e2; color: #b91c1c; }
.task-priority.priority-sredni { background: #ffedd5; color: #9a3412; }
.task-priority.priority-niski { background: #dcfce7; color: #166534; }
.status-badge { flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; background: #e8eef5; color: #34445a; font-size: 13px; font-weight: 800; }
.recommendation-meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid #e5e9ee; }
.recommendation-meta-grid div { padding: 14px 20px; border-right: 1px solid #e5e9ee; }
.recommendation-meta-grid div:last-child { border-right: 0; }
.recommendation-meta-grid dt { color: #718096; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.recommendation-meta-grid dd { margin: 4px 0 0; font-weight: 700; }
.recommendation-action-card,
.recommendation-review-card,
.recommendation-list-card { padding: 20px; }
.recommendation-action-card > h2,
.recommendation-review-card > h2,
.recommendation-list-card > h2 { margin-top: 0; }
.recommendation-action-card textarea { min-height: 150px; }
.recommendation-collapsible { padding: 0; overflow: hidden; }
.recommendation-collapsible > summary { padding: 18px 20px; cursor: pointer; list-style: none; }
.recommendation-collapsible > summary::-webkit-details-marker { display: none; }
.recommendation-collapsible > summary strong,
.recommendation-collapsible > summary small { display: block; }
.recommendation-collapsible > summary small { margin-top: 3px; color: #718096; }
.recommendation-collapsible-body { padding: 0 20px 20px; border-top: 1px solid #e5e9ee; }
.recommendation-review-card > article { padding: 18px 0; border-top: 1px solid #e5e9ee; }
.recommendation-review-card > article:first-of-type { border-top: 0; }

/* Rejestry i raporty z kontroli */
.control-register-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}
.control-register-heading-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 650px;
}
.scope-switch,
.report-tabs {
    display: inline-flex;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    margin-bottom: 18px;
}
.scope-switch a,
.report-tabs a {
    padding: 10px 15px;
    color: #475569;
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
    border-right: 1px solid var(--line);
}
.scope-switch a:last-child,
.report-tabs a:last-child { border-right: 0; }
.scope-switch a.active,
.scope-switch a:hover,
.report-tabs a:hover { background: #fff4e9; color: #bd4b08; text-decoration: none; }
.control-register-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 12px;
    padding: 16px 0 18px;
    margin-bottom: 18px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.control-register-filters .form-row { min-width: 0; }
.control-register-filters select,
.control-register-filters input { width: 100%; min-width: 0; }
.control-register-filter-actions { display: flex; align-items: flex-end; gap: 8px; }
.report-section {
    scroll-margin-top: 18px;
    padding: 24px 0;
    border-top: 1px solid var(--line);
}
.report-section:first-of-type { border-top: 0; padding-top: 0; }
.report-section h2 { margin-top: 0; }
.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.report-kpi {
    min-width: 0;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-top: 3px solid #3b82f6;
    border-radius: 8px;
}
.report-kpi > span,
.report-kpi > small { display: block; color: var(--muted); font-size: 12px; }
.report-kpi > strong { display: block; margin: 5px 0 4px; font-size: 27px; line-height: 1; }
.report-kpi.tone-red { border-top-color: #dc2626; }
.report-kpi.tone-amber { border-top-color: #f59e0b; }
.report-kpi.tone-green { border-top-color: #16a34a; }
.report-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.report-chart {
    min-width: 0;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.report-chart-wide { grid-column: 1 / -1; }
.report-chart h3 { margin: 0 0 4px; font-size: 17px; }
.chart-legend { display: flex; gap: 16px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.chart-legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; }
.legend-controls::before { background: #2563eb; }
.legend-created::before { background: #f97316; }
.legend-completed::before { background: #16a34a; }
.monthly-chart {
    height: 240px;
    display: flex;
    align-items: stretch;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 4px 0;
    border-bottom: 1px solid #d9e1ea;
}
.monthly-chart-column { flex: 1 0 56px; min-width: 56px; display: grid; grid-template-rows: 1fr auto; gap: 7px; text-align: center; }
.monthly-chart-bars { display: flex; align-items: end; justify-content: center; gap: 3px; min-height: 0; }
.monthly-chart-bars i { width: 10px; min-height: 2px; border-radius: 3px 3px 0 0; }
.bar-controls { background: #2563eb; }.bar-created { background: #f97316; }.bar-completed { background: #16a34a; }
.monthly-chart-column > span { color: #64748b; font-size: 10px; white-space: nowrap; }
.status-chart,
.horizontal-chart,
.controller-chart,
.company-chart { display: grid; gap: 12px; }
.status-chart > div { display: grid; grid-template-columns: minmax(120px, 1fr) 35px; gap: 6px 10px; align-items: center; }
.status-chart > div > i { grid-column: 1 / -1; height: 7px; overflow: hidden; background: #edf1f5; border-radius: 999px; }
.status-chart em,
.horizontal-chart em,
.company-chart em { display: block; height: 100%; min-width: 2px; background: #f97316; border-radius: 999px; }
.status-chart .status-do_wykonania { background: #f97316; }.status-chart .status-w_trakcie { background: #2563eb; }.status-chart .status-do_weryfikacji { background: #d97706; }.status-chart .status-wykonane { background: #16a34a; }.status-chart .status-niewykonane { background: #dc2626; }
.horizontal-chart > div { display: grid; grid-template-columns: minmax(130px, 1.4fr) minmax(120px, 2fr) 30px; gap: 10px; align-items: center; }
.horizontal-chart > div > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.horizontal-chart > div > i,
.company-chart > div > i { height: 9px; background: #edf1f5; border-radius: 999px; overflow: hidden; }
.controller-row { display: grid; grid-template-columns: minmax(125px, 1.2fr) minmax(140px, 2fr) minmax(140px, 2fr) 76px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #edf1f5; }
.controller-row:last-child { border-bottom: 0; }
.controller-row > span { font-weight: 700; }
.controller-row > div { position: relative; height: 24px; background: #edf1f5; border-radius: 4px; overflow: hidden; }
.controller-row i { display: block; height: 100%; min-width: 2px; }
.controller-controls { background: #bfdbfe; }.controller-recommendations { background: #fed7aa; }
.controller-row small { position: absolute; inset: 0; display: grid; place-items: center; color: #24344a; font-weight: 750; }
.controller-row > b { text-align: right; font-size: 11px; color: #64748b; }
.company-chart > div { display: grid; grid-template-columns: minmax(170px, 1.2fr) minmax(170px, 2fr) 75px minmax(170px, 2fr) 80px; gap: 10px; align-items: center; }
.company-chart .company-rec em { background: #2563eb; }
.table-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.register-table { min-width: 1080px; }
.register-table td { vertical-align: top; }
.register-table small { color: var(--muted); white-space: nowrap; }
.register-table tr.is-overdue td { background: #fff7f7; }
.status-pill { display: inline-block; padding: 5px 8px; border-radius: 999px; background: #e8eef5; color: #34445a; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-pill.status-wykonane { background: #dcfce7; color: #166534; }
.status-pill.status-do_weryfikacji { background: #fef3c7; color: #92400e; }
.status-pill.status-niewykonane { background: #fee2e2; color: #991b1b; }
.external-register-placeholder {
    display: flex;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: repeating-linear-gradient(-45deg, #f8fafc, #f8fafc 10px, #f3f6f9 10px, #f3f6f9 20px);
}
.external-register-placeholder > div { max-width: 680px; }
.external-register-placeholder span { color: #bd4b08; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.external-register-placeholder h2 { margin: 8px 0; }
.external-register-placeholder p { margin: 0; color: var(--muted); }
.empty-state { color: var(--muted); text-align: center; padding: 20px; }
.control-register-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 0;
    margin: 6px 0 16px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.control-register-notice strong,
.control-register-notice span { display: block; }
.control-register-notice span { margin-top: 3px; color: var(--muted); font-size: 13px; }

@media (max-width: 1180px) {
    .control-register-heading { display: block; }
    .control-register-heading-actions { justify-content: flex-start; margin-top: 14px; max-width: none; }
    .control-register-filters { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    .report-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .control-register-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .control-register-filter-actions { grid-column: 1 / -1; }
    .report-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-chart-grid { grid-template-columns: 1fr; }
    .report-chart-wide { grid-column: auto; }
    .controller-row { grid-template-columns: 1fr; }
    .controller-row > b { text-align: left; }
    .company-chart > div { grid-template-columns: minmax(120px, 1fr) minmax(110px, 2fr) 70px; }
    .company-chart > div .company-rec { grid-column: 2; }
    .control-register-notice { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) {
    .control-register-heading-actions .btn { flex: 1 1 calc(50% - 8px); text-align: center; }
    .control-register-filters { grid-template-columns: 1fr; }
    .control-register-filter-actions { grid-column: auto; }
    .report-kpi { padding: 13px; }
    .report-kpi > strong { font-size: 24px; }
    .report-chart { padding: 14px; }
    .horizontal-chart > div { grid-template-columns: minmax(100px, 1.2fr) minmax(80px, 1.6fr) 25px; }
}
.recommendation-proof-photo { display: inline-block; margin: 10px 0; }
.recommendation-proof-photo img { display: block; width: min(320px, 100%); max-height: 280px; object-fit: cover; border: 1px solid #d8e0e8; }
.decision-form { margin-top: 14px; }
.decision-form label { display: block; color: #526176; font-size: 13px; font-weight: 700; }
.decision-form textarea { width: 100%; min-height: 90px; margin: 5px 0 10px; }
.decision-form > div { display: flex; flex-wrap: wrap; gap: 8px; }
.recommendation-list { display: grid; gap: 8px; }
.recommendation-list > a { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid #dfe5eb; color: #172033; }
.recommendation-list > a.active { border-color: #f97316; background: #fff7ed; }
.recommendation-list > a span { color: #b94708; font-size: 12px; font-weight: 800; }
.recommendation-list > a small { color: #68768a; text-align: right; }
.recommendation-history p { margin: 0; padding: 14px 0; border-bottom: 1px solid #e5e9ee; }
.recommendation-history p:last-child { border-bottom: 0; }

@media (max-width: 767px) {
    .recommendation-page-header { display: block; }
    .recommendation-header-actions { margin-top: 12px; }
    .recommendation-header-actions .btn { flex: 1 1 auto; text-align: center; }
    .recommendation-focus-heading { display: block; padding: 16px; }
    .recommendation-focus-heading .status-badge { display: inline-block; margin-top: 12px; }
    .recommendation-meta-grid { grid-template-columns: 1fr 1fr; }
    .recommendation-meta-grid div:nth-child(2) { border-right: 0; }
    .recommendation-meta-grid div:nth-child(-n+2) { border-bottom: 1px solid #e5e9ee; }
    .recommendation-list > a { grid-template-columns: 1fr; gap: 5px; }
    .recommendation-list > a small { text-align: left; }
    .decision-form > div { display: grid; grid-template-columns: 1fr 1fr; }
    .decision-form > div .btn { width: 100%; }
}
.checklist-library-list > article:first-child { border-top: 0; }
.checklist-library-list h3 { margin: 3px 0 5px; }
.checklist-library-list p { margin: 0 0 7px; color: #657287; }
.checklist-library-list .actions { display: flex; flex-wrap: wrap; gap: 7px; }
.checklist-builder-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding-bottom: 12px;
}
.builder-section-form { display: grid; grid-template-columns: minmax(220px, 1fr) 90px; gap: 8px; padding: 12px 0; border-top: 1px solid #e3e8ee; }
.builder-section-form textarea { grid-column: 1 / -1; }
.builder-section-form .btn { justify-self: start; }
.builder-items { border-top: 1px solid #e3e8ee; }
.builder-item { border-bottom: 1px solid #e3e8ee; }
.builder-item > summary { display: flex; gap: 10px; padding: 12px 0; cursor: pointer; }
.builder-item > summary span,
.builder-item.readonly > span { min-width: 36px; color: #c94f08; font-weight: 800; }
.builder-item.readonly { display: flex; gap: 10px; padding: 12px 0; }
.compact-form { padding: 12px 0 18px; }
.builder-add-item { margin-top: 14px; }
.builder-add-item > summary { color: #b94708; font-weight: 700; cursor: pointer; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 20px; margin: 10px 0; }
.checkbox-row input { width: 18px; height: 18px; vertical-align: middle; }
.publish-bar { display: flex; justify-content: space-between; align-items: center; gap: 24px; border-left: 4px solid #f97316; }
.publish-bar h2 { margin-bottom: 4px; }
.publish-bar p { margin: 0; color: #657287; }
@media (max-width: 767px) {
    .checklist-library-list > article,
    .publish-bar { display: block; }
    .checklist-library-list .actions,
    .publish-bar form { margin-top: 14px; }
    .builder-section-form { grid-template-columns: 1fr; }
    .builder-section-form textarea { grid-column: auto; }
}
