:root {
  --bg: #f4f5f7; --panel: #fff; --ink: #1c2430; --muted: #6a7482; --line: #dfe3e8; --accent: #1f5fa8; --accent-soft: #e6eef8;
  --ok: #1e8a4c; --ok-soft: #e2f3e9; --warn: #b7791f; --warn-soft: #fbf0d9; --bad: #c0392b; --bad-soft: #fbe6e3; --info: #3b6fb5; --info-soft: #e4ecf8; --none: #a9b1bb;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 "Segoe UI", system-ui, sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 4px; } h2 { font-size: 15px; margin: 0 0 10px; } h3 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; } .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .gap { height: 14px; }

/* układ */
.shell { display: grid; grid-template-columns: 216px 1fr; height: 100vh; }
.side { background: #18222f; color: #cfd8e3; display: flex; flex-direction: column; overflow-y: auto; }
.side .brand { padding: 16px 16px 10px; font-weight: 600; font-size: 16px; color: #fff; }
.side .proj { padding: 0 16px 12px; font-size: 12px; color: #93a1b3; border-bottom: 1px solid #2a3747; }
.side nav a { display: flex; justify-content: space-between; padding: 9px 16px; color: #cfd8e3; border-left: 3px solid transparent; }
.side nav a:hover { background: #202d3d; text-decoration: none; } .side nav a.on { background: #24344a; border-left-color: #6aa5ee; color: #fff; }
.side .badge { background: #c0392b; color: #fff; border-radius: 9px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.side .foot { margin-top: auto; padding: 12px 16px; border-top: 1px solid #2a3747; font-size: 12px; }
.side .foot select, .side .foot button { width: 100%; margin-top: 6px; background: #202d3d; border: 1px solid #36465a; color: #dfe7f0; border-radius: 5px; padding: 5px 6px; }
.main { overflow: auto; padding: 18px 22px 40px; }
.viewas { background: var(--warn-soft); border: 1px solid #ecd59b; color: #7a5310; padding: 7px 12px; border-radius: 6px; margin-bottom: 12px; }

/* elementy */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi .v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; } .kpi .l { color: var(--muted); font-size: 12px; } .kpi .s { font-size: 12px; margin-top: 2px; }
.btn { background: var(--panel); border: 1px solid #c5ccd6; border-radius: 6px; padding: 5px 11px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f0f3f7; } .btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.pri:hover { background: #184e8c; }
.btn.sm { padding: 2px 8px; font-size: 12px; } .btn.danger { color: var(--bad); border-color: #e3b5ae; } .btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea { border: 1px solid #c5ccd6; border-radius: 6px; padding: 5px 8px; background: #fff; max-width: 100%; }
textarea { width: 100%; min-height: 70px; resize: vertical; }
label.f { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 3px; }
table { border-collapse: collapse; width: 100%; } th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; white-space: nowrap; }
td { padding: 5px 8px; border-bottom: 1px solid #edf0f3; vertical-align: top; } tr.click { cursor: pointer; } tr.click:hover td, tr.sel td { background: var(--accent-soft); }
.tablewrap { overflow: auto; max-height: calc(100vh - 190px); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.pill { display: inline-block; border-radius: 10px; padding: 0 8px; font-size: 11.5px; line-height: 19px; white-space: nowrap; background: #eceff3; color: #4b5563; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.info { background: var(--info-soft); color: var(--info); }
.bar { height: 7px; background: #e6e9ee; border-radius: 4px; overflow: hidden; min-width: 60px; position: relative; } .bar > i { display: block; height: 100%; background: var(--ok); } .bar > b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #333; }
.split { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(380px, 46%); gap: 14px; align-items: start; }
.split > .detail { position: sticky; top: 0; max-height: calc(100vh - 60px); overflow: auto; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .shell { grid-template-columns: 1fr; height: auto; } .side { position: static; } }

/* drzewo */
.tree .n { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-bottom: 1px solid #f0f2f5; cursor: pointer; }
.tree .n:hover, .tree .n.sel { background: var(--accent-soft); }
.tree .tw { width: 16px; color: var(--muted); flex: none; text-align: center; user-select: none; }
.tree .code { font-family: Consolas, monospace; font-size: 12px; color: #44506a; flex: none; }
.tree .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .lv-Strefa > .nm { font-weight: 600; } .tree .lv-Stanowisko > .nm { font-weight: 500; }
.dots { display: flex; gap: 3px; flex: none; } .dot { font-size: 10.5px; border-radius: 3px; padding: 0 4px; line-height: 16px; background: #eceff3; color: #5b6573; font-variant-numeric: tabular-nums; }
.dot.s1 { background: var(--info-soft); color: var(--info); } .dot.s2 { background: var(--warn-soft); color: var(--warn); } .dot.s4 { background: var(--ok-soft); color: var(--ok); } .dot.s5 { background: var(--bad-soft); color: var(--bad); } .dot.s9 { opacity: .45; }

/* gantt */
.gantt { position: relative; height: 14px; min-width: 260px; background: repeating-linear-gradient(90deg, transparent 0 calc(100%/14 - 1px), #eef0f3 calc(100%/14 - 1px) calc(100%/14)); }
.gantt .p { position: absolute; top: 3px; height: 8px; background: #b9c7da; border-radius: 2px; } .gantt .p.g { background: #5d6b7e; height: 4px; top: 5px; }
.gantt .d { position: absolute; top: 3px; height: 8px; background: var(--ok); border-radius: 2px; } .gantt .f { position: absolute; top: 1px; height: 12px; border: 1.5px dashed var(--bad); border-radius: 2px; }
.gantt .t { position: absolute; top: -3px; bottom: -3px; width: 1.5px; background: #d35400; } .gantt .m { position: absolute; top: 2px; width: 9px; height: 9px; background: #333; transform: translateX(-4px) rotate(45deg); }
.st-late td:first-child, .st-notstarted td:first-child { box-shadow: inset 3px 0 0 var(--bad); } .st-done td { color: #7b8794; }
svg text { font: 11px "Segoe UI", sans-serif; fill: var(--muted); }
.login { max-width: 340px; margin: 12vh auto; } .err { color: var(--bad); margin-top: 8px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 3px 10px; font-size: 13px; } .kv > :nth-child(odd) { color: var(--muted); }
.toast { position: fixed; right: 18px; bottom: 18px; background: #18222f; color: #fff; padding: 9px 14px; border-radius: 6px; z-index: 9; max-width: 480px; white-space: pre-wrap; }
.detail table select { max-width: 132px; } .detail table input[type=date] { width: 122px; } .detail table input[type=text] { width: 110px !important; } .detail td, .detail th { padding: 5px 5px; } .detail .card { overflow-x: auto; }
.split.sched { grid-template-columns: minmax(0, 1fr) 340px; } .sched td:first-child { min-width: 300px; } .sched td:last-child { min-width: 240px; }
