/* ProcessFlow · WorkFlow W005. Loaded only by the module's three HTML views. */
body.pf-w005 {
    color-scheme: dark;
    --bg: #19191c;
    --surface: #232326;
    --raised: #2c2c30;
    --dialog: #242427;
    --line: #404044;
    --t1: #f6f5f3;
    --t2: #cfcecc;
    --t3: #aeadaa;
    --lime: #7ddc1d;
    --accent: var(--lime);
    --tint: #303c28;
    --success: #79d5ad;
    --warn: #f3cb80;
    --error: #ff9da9;
    --text-primary: var(--t1);
    --text-secondary: var(--t2);
    --text-muted: var(--t3);
    --glass-bg: var(--surface);
    --glass-border: var(--line);
    --mokadi-primary: var(--accent);
    --accent-green: var(--success);
    --accent-red: var(--error);
    background: var(--bg);
    color: var(--t1);
    accent-color: var(--accent);
    font-family: "Segoe UI", Inter, system-ui, sans-serif;
}
body.pf-w005.light-theme {
    color-scheme: light;
    --bg: #f4f4f1;
    --surface: #fff;
    --raised: #eeefea;
    --dialog: #fbfbf8;
    --line: #cccec7;
    --t1: #20221e;
    --t2: #444840;
    --t3: #5d6258;
    --accent: #437719;
    --tint: #e6f1dc;
    --success: #216b4b;
    --warn: #82520b;
    --error: #a12740;
}
body.pf-w005 .gradient-background { background: var(--bg); }
body.pf-w005 [hidden] { display: none !important; }
body.pf-w005 :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
body.pf-w005 button, body.pf-w005 input, body.pf-w005 select { font-family: inherit; }
body.pf-w005 .main-header {
    --t1: #f6f5f3;
    --t2: #d8d7d4;
    --t3: #bab9b6;
    --accent: #7ddc1d;
    gap: 16px;
    height: auto;
    min-height: 68px;
    padding: 10px clamp(16px, 3.5vw, 56px);
    background: #151518;
    border-bottom: 1px solid #353539;
    backdrop-filter: none;
}
body.pf-w005 .header-accent-line, body.pf-w005 .header-divider { display: none; }
body.pf-w005 .header-left { gap: clamp(9px, 1.4vw, 22px); }
body.pf-w005 .header-brand { position: static; transform: none; gap: 9px; }
body.pf-w005 .processflow-logo { width: 36px; height: 36px; filter: none; }
.pf-wordmark { color: #f6f5f3; font-size: 24px; font-weight: 720; letter-spacing: -1.1px; line-height: 1; }
.pf-wordmark span { color: #7ddc1d; }
body.pf-w005 .header-left-sep { height: 28px; background: #48484b; }
body.pf-w005 .mokadi-logo { width: auto; height: 34px; }
body.pf-w005 .mokadi-logo-link { opacity: 1; }
body.pf-w005 .header-actions { gap: 8px; }
body.pf-w005 .main-header :is(.back-button, .theme-toggle, .logout-button, .header-user) {
    background: #242427;
    color: var(--t1);
    border: 1px solid #424246;
    box-shadow: none;
}
body.pf-w005 .main-header :is(.back-button, .theme-toggle, .logout-button):hover { background: #343438; border-color: #747471; transform: none; }
body.pf-w005 .main-header :is(.back-button, .theme-toggle, .logout-button) { min-height: 36px; border-radius: 8px; }
body.pf-w005 .header-user { border-radius: 30px; padding: 3px 5px 3px 3px; gap: 8px; }
body.pf-w005 .header-user .logout-button { border-color: transparent; background: transparent; }
body.pf-w005 .user-avatar { width: 32px; height: 32px; border: 0; background: #811c37; color: #fff; cursor: pointer; }
body.pf-w005 .main-header .user-name { color: var(--t1); overflow: hidden; text-overflow: ellipsis; }
body.pf-w005 .main-header .user-status { color: var(--t3); }
body.pf-w005 .container { max-width: 1512px; padding: 22px clamp(16px, 3.5vw, 56px) 48px; margin: 0 auto; }
body.pf-w005 :is(.proc-page, .procedure-container) { width: 100%; max-width: 1072px; padding: 22px clamp(16px, 3.5vw, 48px) 48px; margin: 0 auto; }
body.pf-w005 :is(.breadcrumb-nav, .proc-breadcrumb, .breadcrumb) {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 0; margin: 0 0 18px;
    color: var(--t3); font-size: .8rem; line-height: 1.45;
}
body.pf-w005 .breadcrumb-nav:has(> :only-child) { display: none; }
body.pf-w005 :is(.bc-item, .bc, .proc-breadcrumb a, .breadcrumb a) {
    font: inherit; color: var(--t2); background: none; border: 0; cursor: pointer; text-decoration: none;
}
body.pf-w005 :is(.bc-item, .bc, .proc-breadcrumb a, .breadcrumb a):hover { color: var(--accent); text-decoration: underline; }
body.pf-w005 :is(.bc-item.active, .proc-breadcrumb .cur) { color: var(--accent); }
body.pf-w005 .level-header { margin: 4px 0 23px; }
body.pf-w005 :is(.level-title, .proc-title-h1, .procedure-title) {
    background: none; color: var(--t1); -webkit-text-fill-color: currentColor;
    font-size: clamp(1.65rem, 2.65vw, 2.4rem); line-height: 1.2;
    font-weight: 650; letter-spacing: -.035em; margin: 0; overflow-wrap: anywhere;
}
body.pf-w005 .level-subtitle { color: var(--t3); font-size: .94rem; margin-top: 6px; }
.pf-list-heading {
    display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line);
    padding-bottom: 9px; margin-bottom: 14px;
}
.pf-list-heading h2 { color: var(--t2); font-size: .85rem; font-weight: 600; }
.pf-list-heading span { color: var(--accent); background: var(--tint); font-size: .72rem; font-weight: 650; padding: 1px 7px; border-radius: 5px; }
.pf-symbols { position: absolute; overflow: hidden; pointer-events: none; }
body.pf-w005 :is(.grid-l1, .grid-l2, .grid-l3) { display: grid; gap: 12px; }
body.pf-w005 .grid-l1 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 266px), 1fr)); }
body.pf-w005 .grid-l2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
body.pf-w005 .grid-l3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 315px), 1fr)); }
body.pf-w005 :is(.cat-tile, .subcat-tile, .proc-tile) {
    position: relative; width: 100%; min-width: 0; display: flex; gap: 12px; align-items: center;
    padding: 18px; text-align: left; text-decoration: none; cursor: pointer;
    color: var(--t1); background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 2px 5px rgb(0 0 0 / 6%); font: inherit;
}
body.pf-w005 :is(.cat-tile, .subcat-tile, a.proc-tile):hover { background: var(--raised); border-color: var(--accent); }
body.pf-w005 .cat-tile { flex-direction: column; align-items: flex-start; gap: 8px; padding: 17px 44px 16px 19px; }
body.pf-w005 :is(.cat-icon, .subcat-icon-wrap) {
    display: grid; place-items: center; width: 36px; height: 36px; flex: none;
    color: var(--accent); background: var(--tint); border-radius: 9px;
}
.pf-category-icon { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; fill: none; }
body.pf-w005 :is(.cat-name, .subcat-name, .proc-title-text) { font-size: .99rem; line-height: 1.35; font-weight: 620; }
body.pf-w005 :is(.cat-count, .subcat-count, .proc-empty) { color: var(--t3); font-size: .82rem; }
body.pf-w005 .cat-count { margin-top: auto; }
body.pf-w005 :is(.cat-arrow, .subcat-arrow, .proc-arrow-icon) { margin-left: auto; color: var(--t3); font-size: 1.15rem; }
body.pf-w005 .cat-arrow { position: absolute; right: 17px; bottom: 14px; }
body.pf-w005 .unread-badge, body.pf-w005 .pf-label { width: fit-content; padding: 2px 7px; border-radius: 5px; font-size: .67rem; font-weight: 650; }
body.pf-w005 .unread-badge, body.pf-w005 .pf-unread { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
body.pf-w005 .cat-tile .unread-badge { position: absolute; right: 12px; top: 16px; }
body.pf-w005 .subcat-tile.has-unread { flex-wrap: wrap; }
body.pf-w005 .subcat-tile .unread-badge { order: 1; }
body.pf-w005 .pf-label { display: block; margin-top: 5px; }
body.pf-w005 .proc-tile[aria-disabled] { color: var(--t3); cursor: not-allowed; box-shadow: none; }
body.pf-w005 .proc-status-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--t3); }
body.pf-w005 .proc-status-dot.w_trakcie { background: var(--warn); }
body.pf-w005 .proc-status-dot.gotowe { background: var(--success); }
body.pf-w005 .proc-search { margin-bottom: 16px; }
body.pf-w005 :is(.proc-search-input, .lock-pin-input, .ql-tooltip input[type=text]) {
    width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px;
    color: var(--t1); background: var(--surface); font-size: .94rem;
}
body.pf-w005 input::placeholder { color: var(--t3); }
body.pf-w005 .proc-search-input:focus, body.pf-w005 .lock-pin-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--tint); }
body.pf-w005 :is(.level-back-btn, .btn-status, .btn-cancel, .proc-print-btn, .btn-view, #btnCancelApprove) {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px;
    background: var(--surface); color: var(--t2); border: 1px solid var(--line);
    font-size: .86rem; font-weight: 550; text-decoration: none; cursor: pointer;
}
body.pf-w005 .level-back-btn { margin-bottom: 14px; }
body.pf-w005 :is(.level-back-btn, .btn-status, .btn-cancel, .proc-print-btn, .btn-view):hover {
    color: var(--t1); border-color: var(--accent); background: var(--raised);
}
body.pf-w005 .btn-status option { color: var(--t1); background: var(--dialog); }
body.pf-w005 :is(.proc-header, .procedure-header, .approval-section, .editor-wrap, .section) {
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: none;
}
body.pf-w005 :is(.proc-header, .procedure-header) { padding: clamp(18px, 3vw, 28px); margin: 0 0 18px; }
body.pf-w005 :is(.proc-header, .procedure-header)::before { background: var(--accent); width: 3px; }
body.pf-w005 :is(.proc-header-top, .proc-meta, .editor-toolbar > div, .approval-header, #approvalActionWrap, .history-item, .snapshot-header) { flex-wrap: wrap; }
body.pf-w005 .proc-header-top { gap: 12px; }
body.pf-w005 .proc-title-h1 { font-size: clamp(1.45rem, 2.4vw, 1.95rem); }
body.pf-w005 .proc-meta { color: var(--t3); row-gap: 6px; }
body.pf-w005 :is(.proc-meta span, .approval-count, .status-badge.puste) { color: var(--t2); }
body.pf-w005 .status-badge.puste, body.pf-w005 .approval-count { background: var(--raised); border-color: var(--line); }
body.pf-w005 .status-badge.w_trakcie, body.pf-w005 .approval-my.unsigned { color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, var(--surface)); }
body.pf-w005 .status-badge.gotowe, body.pf-w005 .approval-my.signed, body.pf-w005 .save-msg { color: var(--success); }
body.pf-w005 .editor-toolbar { gap: 10px; }
body.pf-w005 :is(.btn-save, .lock-unlock-btn, .btn-approve.not-signed) {
    color: #17200f; background: var(--lime); border: 1px solid transparent; box-shadow: none; font-weight: 670;
}
body.pf-w005 :is(.btn-save, .lock-unlock-btn, .btn-approve.not-signed):enabled:hover { color: #17200f; background: #96e846; box-shadow: none; }
body.pf-w005 button:disabled { opacity: .53; cursor: not-allowed; }
body.pf-w005 .ql-toolbar.ql-snow { background: var(--raised); border-color: var(--line) !important; }
body.pf-w005 .ql-container.ql-snow, body.pf-w005 .ql-editor { color: var(--t1); background: var(--surface); min-height: 240px; }
body.pf-w005 .ql-container.ql-snow { height: auto; }
body.pf-w005 .ql-editor { padding: 18px clamp(15px, 3vw, 30px); }
body.pf-w005 .ql-editor :is(h1,h2,h3) { color: var(--t1); }
body.pf-w005 .ql-editor blockquote { color: var(--t2); background: var(--raised); border-color: var(--accent); }
body.pf-w005 .ql-editor pre.ql-syntax { color: var(--t1); background: var(--raised); border-color: var(--line); }
body.pf-w005 .ql-snow .ql-picker-options, body.pf-w005 .ql-snow .ql-tooltip { color: var(--t1); background: var(--dialog) !important; border-color: var(--line) !important; }
body.pf-w005 .ql-snow :is(.ql-action, .ql-remove, .ql-preview), body.pf-w005 .ql-editor a { color: var(--accent); }
body.pf-w005 .ql-snow.ql-toolbar :is(button.ql-active, button:hover) .ql-stroke { stroke: var(--accent) !important; }
body.pf-w005 .approval-header { border-color: var(--line); gap: 12px; }
body.pf-w005 :is(.approval-date, .approval-empty, .modal-desc, .history-item-meta) { color: var(--t3); }
body.pf-w005 .modal-overlay { max-width: none; max-height: none; border: none; padding: 0; background: transparent; }
body.pf-w005 dialog::backdrop { background: rgb(12 12 14 / 75%); }
body.pf-w005 .modal-box {
    background: var(--dialog); color: var(--t1); border-color: var(--line); border-top: 2px solid var(--accent);
    max-height: 88dvh; overflow-y: auto; box-shadow: 0 18px 55px rgb(0 0 0 / 30%);
}
body.pf-w005 :is(.users-list, .history-item, .snapshot-content) { background: var(--surface); color: var(--t1); border-color: var(--line); }
body.pf-w005 .user-cb-item:hover { background: var(--raised); }
body.pf-w005 .btn-delete { color: var(--error); }
body.pf-w005 #snapshotView { width: 100%; height: 100%; max-width: none; max-height: none; border: none; background: var(--bg); color: var(--t1); }
body.pf-w005 .snapshot-header { background: var(--dialog); border-color: var(--line); }
body.pf-w005 .snapshot-title { color: var(--t1); }
body.pf-w005 .snapshot-header .btn-cancel, body.pf-w005 #btnCancelApprove { color: var(--t2) !important; background: var(--raised) !important; border-color: var(--line) !important; }
body.pf-w005 :is(.lock-overlay, .modal-overlay) { backdrop-filter: blur(5px); }
body.pf-w005 .lock-overlay { background: rgb(15 15 17 / 90%); }
body.pf-w005 .lock-overlay::before, body.pf-w005 .hard-rules-box::before { content: none; }
body.pf-w005 .lock-container { width: min(92vw, 380px); min-width: 0; padding: 28px; border: 1px solid var(--line); background: var(--dialog); box-shadow: 0 16px 48px #0004; border-radius: 15px; }
body.pf-w005 .lock-icon-wrapper { width: 54px; height: 54px; margin-bottom: 14px; color: var(--accent); background: var(--tint); border: 0; animation: none; }
body.pf-w005 .lock-icon-wrapper svg { width: 29px; }
body.pf-w005 .lock-title { color: var(--t1); text-align: center; font-size: 1.22rem; }
body.pf-w005 :is(.lock-subtitle, .lock-footer-text) { color: var(--t3); text-align: center; }
body.pf-w005 .lock-pin-error { color: var(--error); }
body.pf-w005 .section-header { width: 100%; background: transparent; border: none; color: var(--t1); text-align: start; font: inherit; }
body.pf-w005 .section-header:hover { background: var(--raised); }
body.pf-w005 .section-content-inner { overflow-x: auto; }
body.pf-w005 .hard-rules-box { animation: none; }
body.pf-w005 .raci-table thead th, body.pf-w005 .raci-table tr:hover td { background: var(--raised); }
@media (max-width: 760px) {
    body.pf-w005 .user-info, body.pf-w005 .back-button span { display: none; }
    body.pf-w005 .main-header .back-button { width: 36px; padding: 0; justify-content: center; }
    body.pf-w005 .main-header { gap: 8px; padding: 9px 12px; min-height: 56px; }
    body.pf-w005 .header-left, body.pf-w005 .header-brand, body.pf-w005 .header-actions { gap: 6px; }
    body.pf-w005 .header-user { gap: 2px; }
    body.pf-w005 .processflow-logo { width: 28px; height: 28px; }
    body.pf-w005 .pf-wordmark { font-size: 19px; }
    body.pf-w005 .mokadi-logo { height: 27px; }
    body.pf-w005 .theme-toggle { width: 34px; }
    body.pf-w005 .main-header .logout-button { width: 30px; }
    body.pf-w005 .grid-l1 { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
    body.pf-w005 .cat-tile { padding: 12px; }
    body.pf-w005 .cat-count { padding-right: 12px; }
    body.pf-w005 .cat-arrow { right: 8px; bottom: 8px; }
    body.pf-w005 .cat-tile .unread-badge { position: static; order: 1; }
    body.pf-w005 .cat-name { font-size: .92rem; }
    body.pf-w005 .proc-header-top { align-items: flex-start; flex-direction: column; }
    body.pf-w005 .approval-header, body.pf-w005 .approval-body { padding: 14px; }
    body.pf-w005 .ql-toolbar.ql-snow { padding: 8px; }
    body.pf-w005 .ql-toolbar .ql-formats { margin-right: 4px; }
    body.pf-w005 .snapshot-content { margin: 12px; padding: 14px; }
}
@media (max-width: 440px) {
    body.pf-w005 .main-header { flex-wrap: wrap; }
    body.pf-w005 .header-left { flex: 1 0 auto; }
    body.pf-w005 .header-actions { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
    body.pf-w005 *, body.pf-w005 *::before, body.pf-w005 *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body.pf-w005 dialog.lock-overlay { width: 100%; height: 100%; max-width: none; max-height: none; border: 0; }
body.pf-w005 #ops-connection { background: var(--dialog); color: var(--t1); }
body.pf-w005 .proc-meta > span { display: inline-flex; align-items: baseline; gap: 5px; }
body.pf-w005 .proc-meta small { color: var(--t3); font: inherit; }
body.pf-w005 .approval-item { border-color: var(--line); flex-wrap: wrap; }
body.pf-w005 .approval-avatar { background: var(--tint); color: var(--accent); }
body.pf-w005 .approval-item[data-pending] .approval-avatar { background: var(--raised); color: var(--t3); }
body.pf-w005 .status-badge::before { content: ""; display: inline-block; margin-right: 6px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; vertical-align: .12em; }
body.pf-w005 .ql-snow .ql-picker-label:is(:hover,.ql-active), body.pf-w005 .ql-snow .ql-picker-item.ql-selected { color: var(--accent) !important; }
body.pf-w005 .ql-snow .ql-header :is(.ql-picker-label,.ql-picker-item)::before { content: "Tekst"; }
body.pf-w005 .ql-snow .ql-header :is(.ql-picker-label,.ql-picker-item)[data-value]::before { content: "Nagłówek " attr(data-value); }
body.pf-w005 .ql-snow .ql-picker.ql-header { width: 108px; }
@media (max-width: 540px) {
    body.pf-w005 .grid-l1 { grid-template-columns: 1fr; gap: 8px; }
    body.pf-w005 .cat-tile {
        display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "icon name arrow" "icon count arrow";
        gap: 3px 12px; padding: 12px 14px; align-items: center;
    }
    body.pf-w005 .cat-tile.has-unread { grid-template-areas: "icon name arrow" "icon count arrow" ". badge ."; }
    body.pf-w005 .cat-icon { grid-area: icon; }
    body.pf-w005 .cat-name { grid-area: name; }
    body.pf-w005 .cat-count { grid-area: count; padding: 0; margin: 0; }
    body.pf-w005 .cat-tile .unread-badge { grid-area: badge; margin-top: 3px; }
    body.pf-w005 .cat-arrow { grid-area: arrow; position: static; }
    body.pf-w005 .main-header { padding-inline: 9px; gap: 6px; }
    body.pf-w005 .header-left, body.pf-w005 .header-actions { gap: 4px; }
    body.pf-w005 .header-brand { gap: 4px; }
    body.pf-w005 .main-header .back-button, body.pf-w005 .theme-toggle { width: 32px; }
    body.pf-w005 .main-header #historyToggle { margin-right: 0 !important; }
    body.pf-w005 .proc-meta { display: grid; grid-template-columns: 1fr; }
}
body.pf-w005 .ql-editor { overflow-x: auto; }
body.pf-w005 .ql-editor table { width: 100%; border-collapse: collapse; color: var(--t1); }
body.pf-w005 .ql-editor :is(th, td) { padding: 7px 10px; border: 1px solid var(--line); text-align: start; }
body.pf-w005 .ql-editor th { background: var(--raised); }
body.pf-w005 .subcat-info { display: grid; gap: 2px; }
body.pf-w005 #btnSaveNewVersion { background: var(--tint); color: var(--accent); border-color: var(--line); }
body.pf-w005 #btnSaveNewVersion:enabled:hover { border-color: var(--accent); }
