/* RCP WorkBox — wygląd 1:1 z aplikacją BuildiBox (Figma "BuildiBox", Ant Design 5.18) */

/* ── Fonty lokalne (CSP: font-src 'self') ────────── */
@font-face{font-family:'Public Sans';font-style:normal;font-weight:100 900;font-display:swap;src:url(fonts/public-sans-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Public Sans';font-style:normal;font-weight:100 900;font-display:swap;src:url(fonts/public-sans-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Roboto;font-style:normal;font-weight:100 900;font-display:swap;src:url(fonts/roboto-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:Roboto;font-style:normal;font-weight:100 900;font-display:swap;src:url(fonts/roboto-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Material Symbols Outlined';font-style:normal;font-weight:400;font-display:block;src:url(fonts/material-symbols-outlined.woff2) format('woff2')}
.ms{font-family:'Material Symbols Outlined';font-weight:400;font-style:normal;font-size:20px;line-height:1;letter-spacing:normal;text-transform:none;white-space:nowrap;direction:ltr;-webkit-font-feature-settings:'liga';font-feature-settings:'liga';-webkit-font-smoothing:antialiased;user-select:none}

/* ── Tokeny ──────────────────────────────────────── */
:root{
  --bg:#f8fafb;--white:#fff;--border:#e8ecef;--split:rgba(0,0,0,.06);--row:#f0f0f0;
  --heading:#252631;--muted:#778ca2;--muted-2:#98a9bc;--text:rgba(0,0,0,.88);
  --gold:#faad14;--gold-bb:#fdad00;--gold-hover:#ffc53d;--gold-active:#d48806;
  --danger:#ff4d4f;
  --tag-green-bg:#eafac9;--tag-green:#406311;--tag-amber-bg:#fff2c8;--tag-amber:#9d4f1f;
  --tag-grey-bg:#f1f2f4;--tag-red-bg:#ffe8e6;--tag-red:#a8071a;
  --ps:'Public Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
  --rb:Roboto,'Public Sans',system-ui,sans-serif;
  --sidebar:252px
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:var(--ps);font-size:14px;line-height:21px;background:var(--bg);color:var(--heading);-webkit-font-smoothing:antialiased}
a{color:var(--gold-bb)}
h1,h2,h3{margin:0;color:var(--heading)}
.muted{color:var(--muted)}
.tab-hidden{display:none!important}

/* ── Shell ───────────────────────────────────────── */
.shell{display:grid;grid-template-columns:var(--sidebar) minmax(0,1fr);height:100vh}

/* [Navigation] Sidebar / Menu / Light BB */
.sidebar{position:relative;display:flex;flex-direction:column;justify-content:space-between;height:100vh;padding-bottom:16px;background:var(--white);border-right:1px solid var(--border);z-index:10}
.sidebar-top{display:flex;flex-direction:column;gap:24px;min-height:0;overflow-y:auto}
.logo-box{position:relative;flex:0 0 57px;height:57px;border-bottom:1px solid var(--border)}
.logo-box a{position:absolute;left:24px;top:18.5px;display:block;width:129px;height:20px}
.logo-box img{display:block;width:129px;height:20px}
.panel-toggle{position:absolute;left:239px;top:17px;width:24px;height:24px;padding:0;border:0;background:none;cursor:pointer;z-index:11}
.panel-toggle img{display:block;width:24px;height:24px}
.nav-group{display:flex;flex-direction:column;gap:12px;align-items:center}
.nav-title{position:relative;width:207px;height:21px;font-size:14px;font-weight:300;line-height:21px;color:var(--muted);white-space:nowrap}
.nav-title .ms{position:absolute;right:-1px;top:2px;font-size:14px;color:var(--muted)}
.nav-links{display:flex;flex-direction:column;width:var(--sidebar)}
.nav-link{position:relative;display:block;height:42px;width:var(--sidebar);color:var(--heading);text-decoration:none;font-size:14px;font-weight:600;line-height:1;white-space:nowrap}
.nav-link .ms{position:absolute;left:24px;top:calc(50% - 10px);font-size:20px;color:var(--muted)}
.nav-link .nav-label{position:absolute;left:55px;top:calc(50% - 8px);line-height:16px}
.nav-link:hover .nav-label,.nav-link:hover .ms{color:var(--gold-bb)}
.nav-link.active::before{content:'';position:absolute;top:0;bottom:0;left:12px;right:14px;background:var(--bg);border-radius:8px}
.nav-link.active .ms,.nav-link.active .nav-label{color:var(--gold-bb)}
.nav-link.active::after{content:'';position:absolute;top:0;bottom:0;right:-1px;width:2px;background:var(--gold-bb);border-radius:1px}
.nav-bottom{display:flex;flex-direction:column;justify-content:flex-end}

/* Zwinięty sidebar (left_panel_open) */
.shell.collapsed{--sidebar:72px}
.shell.collapsed .logo-box a{width:14px;overflow:hidden}
.shell.collapsed .logo-box img{object-fit:cover;object-position:left}
.shell.collapsed .panel-toggle{left:59px;transform:scaleX(-1)}
.shell.collapsed .nav-title,.shell.collapsed .nav-label{display:none}
.shell.collapsed .nav-link.active::before{left:10px;right:10px}

/* [Navigation] Header */
.main{position:relative;display:flex;flex-direction:column;min-width:0;height:100vh}
.topbar{position:relative;flex:0 0 57px;height:57px;border-bottom:1px solid var(--border)}
.topbar h1{position:absolute;left:27px;top:calc(50% - 15px);font-size:22px;font-weight:600;line-height:32px;white-space:nowrap}
.topbar-right{position:absolute;right:23px;top:calc(50% + 1px);transform:translateY(-50%);display:flex;align-items:center;gap:24px}
.topbar-icons{display:flex;gap:20px;align-items:center;color:var(--muted)}
.avatar{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#e8ecef;color:var(--muted);font-family:var(--ps);font-size:13px;font-weight:600;letter-spacing:.3px;cursor:default}

/* Content */
.content{flex:1 1 auto;min-height:0;overflow:auto;padding:8px 8px 24px 16px}
.content-inner{display:flex;flex-direction:column;gap:16px}

/* [BB] Footer — pasek akcji */
.action-bar{flex:0 0 56px;display:flex;align-items:center;justify-content:flex-end;gap:12px;height:56px;padding:0 16px;background:var(--bg);border-top:1px solid var(--border)}
.action-bar .status{flex:1 1 auto;min-width:0;margin:0 auto 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ── Tabs (antd, inkBar gold) ────────────────────── */
.tabs-row{display:flex;align-items:center;height:44px}
.tabs{display:flex;gap:32px;border-bottom:1px solid var(--border)}
.tab{display:flex;align-items:center;gap:8px;padding:12px 0;margin-bottom:-1px;border:0;border-bottom:2px solid transparent;border-radius:0;background:none;font-family:var(--ps);font-size:14px;font-weight:600;line-height:22px;color:var(--muted);cursor:pointer;min-height:0}
.tab:hover{color:var(--gold-bb);background:none;border-color:transparent}
.tab.active{color:var(--gold-bb);border-bottom-color:var(--gold)}
.tab .count{display:inline-block;min-width:18px;height:18px;padding:0 6px;border-radius:99px;background:var(--tag-grey-bg);color:var(--muted);font-size:12px;line-height:18px;font-weight:500;text-align:center}

/* ── [Filters] Sorting / Dropdown / Outline ──────── */
.filters{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.f-ctl{display:flex;align-items:stretch;height:34px;background:var(--white);border:1px solid var(--border);border-radius:6px;transition:border-color .2s}
.f-ctl:hover,.f-ctl:focus-within{border-color:var(--gold-bb)}
.f-label{display:flex;align-items:center;padding:6px 12px 7px;border-right:1px solid var(--border);font-size:14px;font-weight:400;line-height:21px;color:var(--muted);white-space:nowrap}
.f-ctl select,.f-ctl input{height:32px;min-height:0;border:0;border-radius:0 6px 6px 0;background:transparent;padding:0 10px 0 12px;font-family:var(--ps);font-size:14px;font-weight:500;color:var(--heading);box-shadow:none;outline:0}
.f-ctl select{appearance:none;-webkit-appearance:none;padding-right:30px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%23778ca2'%3E%3Cpath d='M12 15.4 6 9.4 7.4 8l4.6 4.6L16.6 8 18 9.4z'/%3E%3C/svg%3E") no-repeat right 10px center;cursor:pointer}
.f-ctl input[type=datetime-local],.f-ctl input[type=date]{padding-right:8px}
.f-search .f-ico{display:flex;align-items:center;padding:0 12px;border-right:1px solid var(--border);color:var(--muted)}
.f-search .f-ico .ms{font-size:16px}
.f-search input{width:220px;font-weight:500}
.f-search input::placeholder{color:var(--muted);font-weight:500}
.f-range input{width:178px;padding:0 6px 0 10px}
.filters .f-search input{width:110px}
.filters[data-tab] .f-search input{width:240px}
button.icon-btn{width:34px;height:34px;min-height:34px;padding:0;border-radius:6px}
button.icon-btn .ms{font-size:18px;color:var(--muted)}
button.icon-btn:hover .ms{color:var(--gold-hover)}
.f-sep{display:flex;align-items:center;color:var(--muted-2)}
.f-sep .ms{font-size:16px}
.f-check{flex-direction:row;align-items:center;gap:8px;padding:0 12px;cursor:pointer;font-family:var(--ps);font-size:14px;font-weight:500;line-height:21px;color:var(--heading)}
button .count{display:inline-grid;place-items:center;min-width:18px;height:18px;margin-left:2px;padding:0 5px;border-radius:99px;background:var(--gold);color:#fff;font-size:12px;line-height:18px;font-weight:500}
button .count[hidden]{display:none}
.form-group{display:flex;flex-direction:column;gap:12px}
.form-label{font-family:var(--rb);font-size:12px;line-height:22px;color:var(--muted)}
.form-hint{font-size:12px;line-height:18px;color:var(--muted)}
dialog .check{font-size:14px}
.checks{display:flex;flex-wrap:wrap;gap:8px 24px}

/* ── Checkbox (antd) ─────────────────────────────── */
.check{display:inline-flex;flex-direction:row;align-items:center;gap:8px;font-family:var(--rb);font-size:14px;font-weight:400;line-height:22px;color:var(--text);cursor:pointer}
input[type=checkbox]{appearance:none;-webkit-appearance:none;flex:0 0 16px;width:16px;height:16px;min-height:0;margin:0;padding:0;border:1px solid #d9d9d9;border-radius:4px;background:var(--white);cursor:pointer;position:relative;transition:all .2s}
input[type=checkbox]:hover{border-color:var(--gold)}
input[type=checkbox]:checked{background:var(--gold);border-color:var(--gold)}
input[type=checkbox]:checked::after{content:'';position:absolute;left:4.5px;top:1.5px;width:5px;height:9px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}

/* ── Panel (białe pole, rounded 6, bez ramki) ────── */
.panel{background:var(--white);border-radius:6px}
.panel-pad{padding:24px}
.panel h2{font-size:16px;font-weight:500;line-height:24px;margin-bottom:16px}
.card{background:var(--white);border-radius:6px;padding:24px;margin-bottom:16px}
.card h2{font-size:16px;font-weight:600;line-height:24px;margin:0 0 16px}

/* Stat tiles */
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.stat{padding:14px 20px;background:var(--white);border-radius:6px}
.stat-label{display:block;font-size:12px;line-height:18px;color:var(--muted)}
.stat strong{display:block;margin-top:2px;font-size:22px;line-height:32px;font-weight:600;color:var(--heading)}

/* ── Table (antd: header 46, Roboto 13) ──────────── */
.table-wrapper{overflow-x:auto;background:var(--white);border-radius:6px}
table{width:100%;border-collapse:collapse}
th{height:46px;padding:12px 16px;background:var(--white);border-bottom:1px solid var(--split);text-align:left;font-family:var(--rb);font-size:13px;font-weight:600;line-height:22px;color:var(--muted);white-space:nowrap}
td{padding:12px 16px;border-bottom:1px solid var(--row);text-align:left;vertical-align:middle;font-family:var(--rb);font-size:13px;line-height:22px;color:var(--text);white-space:nowrap}
td strong{font-family:var(--ps);font-size:14px;font-weight:600;color:var(--heading)}
tbody tr:hover>td{background:#fafafa}
.empty{padding:40px 16px!important;text-align:center;color:var(--muted)!important}
.details{min-width:280px;white-space:normal;font-size:12px;line-height:18px;color:var(--muted)}
.small-id{font-size:11px;color:var(--muted)}
.group-row td,.group-row:hover>td{background:var(--bg);font-family:var(--ps)}
.group-row td{padding:12px 16px;height:64px}
.group-row .grp span{margin-left:0}
.group-row .row-user .t strong{font-size:16px}
.grp{position:sticky;left:16px;display:flex;align-items:center;justify-content:space-between;gap:24px;width:calc(100vw - var(--sidebar) - 88px);max-width:100%}
.grp-stats{display:flex;gap:40px;text-align:right}
.grp-stats div{display:flex;flex-direction:column}
.grp-stats b{font-family:var(--rb);font-size:13px;font-weight:600;line-height:22px;color:var(--text)}
.grp-stats span{margin:0!important;font-size:12px!important;line-height:18px;color:var(--muted)}
.grp-stats .warn b{color:var(--tag-red)}
.group-row strong{font-size:14px}
.group-row span{display:inline-block;margin-left:16px;font-size:12px;color:var(--muted)}
.group-row .group-warning{color:var(--tag-red)}
.shift-row td:first-child{border-left:2px solid var(--gold)}
/* Akcje w wierszu: przyciski-linki */
td button{min-height:0;height:auto;padding:0;margin:0 12px 0 0;border:0;border-radius:0;background:none;color:var(--muted);font-family:var(--rb);font-size:13px;font-weight:500;line-height:22px;white-space:nowrap}
td button:hover{background:none;color:var(--gold-bb)}
td button.danger-button{color:var(--danger)}
td button.danger-button:hover{color:#ff7875}
.actions-cell{min-width:300px}
.actions-cell button{margin:0 12px 0 0}

/* Tabela z zaznaczaniem (BuildiBox: brak kolumny akcji, akcje w dolnym pasku) */
table[data-select] th:last-child,table[data-select] tbody td:last-child:not([colspan]){display:none}
table[data-select] tbody td{height:64px}
table[data-select] tbody tr{cursor:pointer;user-select:none}
table[data-select] tbody tr.selected>td,table[data-select] tbody tr.selected:hover>td{background:#fffbe6}
th.lp,td.lp{width:57px;padding-left:8px;padding-right:8px;text-align:center}
.row-btn-missing{display:none!important}
.c{text-align:center}
/* Row / user (avatar 40 + tytuł 16 + podtytuł 12) */
.row-user{display:flex;align-items:center;gap:12px}
.row-user .ava{flex:0 0 40px;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:#f1f2f4;color:var(--muted-2)}
.row-user .ava .ms{font-size:24px}
.row-user .t{display:flex;flex-direction:column;min-width:0}
.row-user .t strong{font-family:var(--ps);font-size:16px;line-height:24px;font-weight:600;color:var(--heading)}
.row-user .t span{font-family:var(--ps);font-size:12px;line-height:18px;color:var(--muted)}
.tags{display:inline-flex;gap:6px;flex-wrap:wrap;justify-content:center}
.filters .spacer{flex:1 1 auto}
/* Tags/xs (pill 18px) */
.badge{display:inline-flex;align-items:center;height:18px;padding:0 8px;border-radius:99px;background:var(--tag-grey-bg);color:var(--muted);font-family:var(--ps);font-size:12px;font-weight:500;line-height:18px;white-space:nowrap}
.badge.ok{background:var(--tag-green-bg);color:var(--tag-green)}
.badge.warning{background:var(--tag-amber-bg);color:var(--tag-amber)}
.badge.error{background:var(--tag-red-bg);color:var(--tag-red)}

/* ── Buttons (antd shape=round) ──────────────────── */
button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:32px;height:32px;padding:0 16px;border:1px solid var(--border);border-radius:9999px;background:var(--white);color:var(--text);font-family:var(--rb);font-size:14px;font-weight:400;line-height:22px;cursor:pointer;white-space:nowrap;transition:color .2s,border-color .2s,background .2s}
button .ms{font-size:16px}
button:hover{color:var(--gold-hover);border-color:var(--gold-hover)}
button:active{color:var(--gold-active);border-color:var(--gold-active)}
button.primary,button[type=submit]{background:var(--gold);border-color:var(--gold);color:#fff}
button.primary:hover,button[type=submit]:hover{background:var(--gold-hover);border-color:var(--gold-hover);color:#fff}
button.danger-button{color:var(--danger);border-color:var(--danger)}
button:disabled,button:disabled:hover{cursor:not-allowed;color:rgba(0,0,0,.25);background:rgba(0,0,0,.04);border-color:var(--border)}
.actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}

/* ── Formularze (antd Form vertical) ─────────────── */
label{display:flex;flex-direction:column;gap:8px;font-family:var(--rb);font-size:12px;font-weight:400;line-height:22px;color:var(--muted)}
input,select,textarea{font:inherit}
.form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}
label input,label select,dialog input,dialog select{height:40px;padding:0 12px;border:1px solid var(--border);border-radius:4px;background:var(--white);font-family:var(--ps);font-size:14px;font-weight:500;line-height:21px;color:var(--heading);transition:border-color .2s}
label input:hover,label select:hover{border-color:var(--gold-bb)}
label input:focus,label select:focus{outline:0;border-color:var(--gold-bb)}
label select,dialog select{appearance:none;-webkit-appearance:none;padding-right:36px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 1024 1024' fill='%23bfbfbf'%3E%3Cpath d='M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z'/%3E%3C/svg%3E") no-repeat right 12px center;cursor:pointer}
label input[readonly]{background:var(--bg);color:var(--muted)}
label input[type=file]{padding:7px 12px;font-weight:400}
code{padding:1px 6px;border:1px solid var(--border);border-radius:4px;background:var(--bg);font-size:12px}
pre{overflow-x:auto;padding:14px;border:1px solid var(--border);border-radius:6px;background:var(--bg)}

/* ── Status / walidacja ──────────────────────────── */
.status{font-size:13px;color:var(--muted)}
.status:empty{display:none}
.status.ok{color:var(--tag-green)}
.status.error{color:var(--danger)}
.validation-box{padding:8px 12px;border-radius:6px;font-size:14px;line-height:21px}
.validation-box:empty{display:none}
.validation-box.ok{background:#f6ffed;color:var(--tag-green)}
.validation-box.error{background:#fff2f0;color:var(--tag-red)}
.progress-bar{height:4px;margin-top:4px;overflow:hidden;border-radius:2px;background:var(--border)}
.progress-fill{width:0;height:100%;background:var(--gold);transition:width .4s ease}

/* ── Drawer (dialog → panel z prawej, "Edycja" 393px) */
dialog{position:fixed;inset:0 0 0 auto;width:393px;max-width:100vw;height:100vh;max-height:100vh;margin:0;padding:0;border:0;background:var(--white);color:var(--heading);box-shadow:0 10px 20px rgba(91,91,91,.1)}
dialog[open]{display:flex;flex-direction:column}
dialog::backdrop{background:rgba(0,0,0,.2)}
dialog h3{position:relative;flex:0 0 57px;height:57px;padding:18px 48px 0 14px;border-bottom:1px solid var(--border);font-size:14px;font-weight:500;line-height:21px;color:var(--muted)}
dialog .dialog-x{position:absolute;right:16px;top:19px;z-index:1;width:20px;height:20px;min-height:0;padding:0;border:0;border-radius:0;background:none;color:var(--muted)}
dialog .dialog-x .ms{font-size:20px}
dialog form{flex:1 1 auto;display:flex;flex-direction:column;min-height:0}
dialog .dialog-fields{flex:1 1 auto;display:flex;flex-direction:column;gap:24px;padding:24px;overflow-y:auto}
dialog .actions{flex:0 0 56px;flex-direction:row-reverse;justify-content:flex-start;gap:8px;margin:0;padding:12px 16px;background:var(--bg);border-top:1px solid var(--border)}
dialog .actions button{padding:0 16px}
#levelPermsGrid{display:flex;flex-direction:column;gap:24px}
#levelPermsGrid fieldset{display:flex;flex-direction:column;gap:12px;border:0!important;padding:0!important;margin:0!important;min-width:0}
#levelPermsGrid legend{float:left;width:100%;padding:0 0 4px!important;font-family:var(--rb);font-size:12px;line-height:22px;font-weight:400!important;color:var(--muted)}
#levelPermsGrid label,.checkbox-label{flex-direction:row;align-items:center;gap:8px;font-size:14px;color:var(--text)}

/* ── Tryb demo: przełącznik w nagłówku, tag przy tytule, baner, złoty pasek u góry */
.demo-switch{display:flex;align-items:center;gap:10px}
.demo-switch-label{font-size:14px;font-weight:500;line-height:21px;color:var(--muted);white-space:nowrap}
body.demo-on .demo-switch-label{color:var(--gold-active);font-weight:600}
button.switch{position:relative;width:44px;min-width:44px;height:22px;min-height:22px;padding:0;border:0;border-radius:100px;background:rgba(0,0,0,.25);transition:background .2s}
button.switch:hover{background:rgba(0,0,0,.45)}
button.switch .knob{position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 2px 4px rgba(0,35,11,.2);transition:left .2s}
button.switch[aria-checked=true]{background:var(--gold)}
button.switch[aria-checked=true]:hover{background:var(--gold-hover)}
button.switch[aria-checked=true] .knob{left:24px}
button.switch:focus-visible{outline:2px solid var(--gold-hover);outline-offset:2px}
.demo-tag{display:inline-flex;align-items:center;height:22px;margin-left:12px;padding:0 8px;border-radius:4px;background:var(--gold);color:#fff;font-size:12px;font-weight:700;line-height:22px;letter-spacing:.8px;vertical-align:middle}
.demo-tag[hidden]{display:none}
body.demo-on .main::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:var(--gold);z-index:6}
.demo-banner{display:flex;align-items:center;gap:16px;padding:12px 16px;border:1px solid var(--warning-border, #ffe58f);border-radius:8px;background:#fffbe6}
.demo-banner[hidden]{display:none}
.demo-banner-ico{flex:0 0 auto;font-size:24px;color:var(--gold)}
.demo-banner-text{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}
.demo-banner-text strong{font-size:14px;font-weight:600;line-height:22px;color:var(--heading)}
.demo-banner-text span{font-size:13px;line-height:20px;color:var(--text)}
.demo-banner button{flex:0 0 auto}
@media(max-width:860px){.demo-switch-label{display:none}.demo-banner{flex-wrap:wrap}}

/* ── Oznaczenie stagingu (fiolet, żeby nie mylić ze złotym trybem demo) */
.env-badge{display:flex;flex-direction:column;padding:4px 10px;border-radius:6px;background:#722ed1;color:#fff;box-shadow:0 4px 12px rgba(114,46,209,.35);font-family:var(--ps);line-height:16px;pointer-events:auto}
.env-badge strong{font-size:12px;letter-spacing:1px}
.env-badge span{font-size:11px;opacity:.85}
.env-badge-float{position:fixed;left:12px;bottom:12px;z-index:1000}
body.env-staging .main::after{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:#722ed1;z-index:6}
body.env-staging .sidebar{border-right-color:#d3adf7}

/* ── Raport: zwijane grupy, kompaktowe szczegóły, stan ładowania */
.group-row{cursor:pointer;user-select:none}
.grp-chevron{font-size:20px;color:var(--muted);transition:transform .2s;transform:rotate(-90deg)}
.group-row[aria-expanded=true] .grp-chevron{transform:rotate(0)}
tr.is-collapsed{display:none}
#results.no-sched th:nth-child(8),#results.no-sched td:nth-child(8){display:none}
.details{min-width:0!important}
.det{display:inline-flex;align-items:center;gap:8px;white-space:nowrap}
.det-ico{font-size:18px;color:var(--muted-2);cursor:help}
.det-ico:hover{color:var(--gold-bb)}
.det-zone{font-size:12px;color:var(--tag-green)}
.det-map{display:inline-flex;color:var(--muted)}
.det-map .ms{font-size:18px}
.det-map:hover{color:var(--gold-bb)}
button.is-loading{position:relative;pointer-events:none}
button.is-loading::before{content:'';width:14px;height:14px;border:2px solid rgba(255,255,255,.5);border-top-color:#fff;border-radius:50%;animation:bbspin .8s linear infinite}
@keyframes bbspin{to{transform:rotate(360deg)}}
.filters .link-btn{font-size:13px;display:inline-flex;align-items:center;gap:4px}
.filters .link-btn .ms{font-size:18px}
/* ── Pracownicy: wiersz pracownika + historia kart */
.row-chevron{display:grid;place-items:center;width:24px;height:24px;min-height:24px;margin:0 -4px 0 -6px;padding:0;border:0;border-radius:4px;background:none;color:var(--muted)}
.row-chevron:hover{background:var(--bg);color:var(--gold-bb)}
.row-chevron .ms{font-size:20px;transition:transform .2s;transform:rotate(-90deg)}
tr[aria-expanded=true] .row-chevron .ms{transform:rotate(0)}
.row-chevron-space{display:inline-block;width:14px}
tr.sub-row>td{background:#fcfdfd;height:48px!important}
.sub-label{display:inline-flex;align-items:center;margin-left:58px;font-size:12px;color:var(--muted)}
.sub-label::before{content:'';width:12px;height:12px;margin-right:8px;border-left:1px solid var(--border);border-bottom:1px solid var(--border);transform:translateY(-4px)}
/* ── Dymki z komunikatami (antd message) */
.toast-box{position:fixed;top:16px;left:50%;transform:translateX(-50%);z-index:2000;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none}
.toast{display:flex;align-items:center;gap:8px;max-width:min(560px,92vw);padding:9px 12px;border-radius:8px;background:#fff;box-shadow:0 6px 16px rgba(0,0,0,.08),0 3px 6px -4px rgba(0,0,0,.12),0 9px 28px 8px rgba(0,0,0,.05);font-size:14px;line-height:22px;color:var(--text);animation:toastin .2s ease-out}
.toast .ms{font-size:18px;color:#52c41a}
.toast.error .ms{color:var(--danger)}
.toast.out{opacity:0;transform:translateY(-8px);transition:all .3s}
@keyframes toastin{from{opacity:0;transform:translateY(-8px)}}

/* ── Import CSV (antd Upload.Dragger + podgląd) */
.dropzone{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;padding:24px 16px;border:1px dashed #d9d9d9;border-radius:8px;background:#fafafa;text-align:center;cursor:pointer;transition:border-color .2s}
.dropzone:hover,.dropzone:focus-within{border-color:var(--gold)}
.dropzone.has-file{border-style:solid;border-color:var(--gold);background:#fffbe6}
.dropzone input[type=file]{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.dropzone .ms{font-size:40px;color:var(--gold)}
.dropzone strong{font-family:var(--ps);font-size:16px;font-weight:500;line-height:24px;color:var(--text)}
.dropzone .dz-hint{font-size:14px;line-height:22px;color:var(--muted)}
.dropzone .file-name{font-family:var(--ps);font-size:14px;font-weight:600;color:var(--heading);word-break:break-all}
.dropzone .file-name:empty{display:none}
.dropzone.has-file .dz-hint{display:none}
.link-btn{display:inline;height:auto;min-height:0;padding:0;border:0;border-radius:0;background:none;color:var(--gold-bb);font-family:var(--ps);font-size:12px;line-height:18px;font-weight:600;cursor:pointer}
.link-btn:hover{background:none;color:var(--gold-active);text-decoration:underline}
.import-preview{display:flex;flex-direction:column;gap:12px}
.import-preview:empty{display:none}
.import-summary{display:grid;grid-template-columns:repeat(3,1fr);border:1px solid var(--border);border-radius:6px}
.import-summary div{display:flex;flex-direction:column;align-items:center;padding:10px 4px;border-right:1px solid var(--border)}
.import-summary div:last-child{border-right:0}
.import-summary b{font-size:20px;line-height:28px;font-weight:600;color:var(--heading)}
.import-summary span{font-size:12px;line-height:18px;color:var(--muted);text-align:center}
.import-skipped{padding:8px 12px;border-radius:6px;background:var(--tag-amber-bg);color:var(--tag-amber);font-size:13px;line-height:20px}
.import-preview ul{margin:4px 0 0;padding-left:18px}

/* ── Popup potwierdzenia (Figma "Popup - usuwanie", 494px) */
dialog.bb-modal{inset:0;margin:auto;width:494px;max-width:calc(100vw - 32px);height:fit-content;max-height:calc(100vh - 32px);border:1px solid var(--border);border-radius:8px;box-shadow:0 0 8.5px rgba(0,0,0,.15);overflow:hidden}
dialog.bb-modal[open]{display:flex;flex-direction:column}
dialog.bb-modal::backdrop{background:rgba(0,0,0,.25)}
.bb-modal-body{display:flex;flex-direction:column;gap:12px;padding:24px}
.bb-modal-ico{display:grid;place-items:center;width:48px;height:48px;margin-left:8px;border-radius:50%;background:radial-gradient(circle,var(--gold) 0 11px,#ffe7ba 12px);color:#fff;font-family:var(--ps);font-size:14px;font-weight:700}
.bb-modal-text{display:flex;flex-direction:column;gap:2px;padding:8px}
.bb-modal-title{font-size:20px;font-weight:600;line-height:36px;color:var(--heading)}
.bb-modal-text p{margin:0;font-size:14px;line-height:21px;color:var(--muted)}
.bb-modal-foot{display:flex;justify-content:flex-end;gap:8px;height:70px;padding:16px;background:var(--bg);border-top:1px solid var(--border)}
.bb-modal-foot button{height:40px;min-height:40px;padding:0 16px;font-size:16px;line-height:24px}

/* ── Dokumentacja ────────────────────────────────── */
.docs .card p,.docs .card li{color:var(--heading)}

/* ── Responsywność ───────────────────────────────── */
@media(max-width:1100px){.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.form-grid{grid-template-columns:1fr 1fr}}
@media(max-width:860px){
  .shell{grid-template-columns:1fr;height:auto}
  .sidebar{height:auto;flex-direction:row;align-items:center;padding:0;border-right:0;border-bottom:1px solid var(--border);overflow-x:auto}
  .sidebar-top{flex-direction:row;align-items:center;gap:0;overflow:visible}
  .logo-box{flex:0 0 170px;border-bottom:0}
  .panel-toggle,.nav-title{display:none}
  .nav-group{flex-direction:row}
  .nav-links,.nav-bottom{flex-direction:row;width:auto}
  .nav-link{width:52px}
  .nav-link .nav-label{display:none}
  .nav-link .ms{left:16px}
  .nav-link.active::before{left:6px;right:6px}
  .nav-link.active::after{top:auto;left:6px;right:6px;width:auto;height:2px}
  .main{height:auto;min-height:calc(100vh - 57px)}
  .content{overflow:visible;padding:8px}
  .action-bar{position:sticky;bottom:0;flex-wrap:wrap;height:auto;padding:12px}
  .form-grid{grid-template-columns:1fr}
}
@media(max-width:520px){.stats{grid-template-columns:1fr 1fr}.f-search input{width:140px}}
