:root {
  --aside: #ffffff;
  --aside-2: #f5f8fa;
  --aside-text: #5e6278;
  --aside-hover: #f1f3f8;
  --aside-active: #4e73df;
  --header: #ffffff;
  --page: #f5f8fa;
  --card: #ffffff;
  --text: #181c32;
  --muted: #a1a5b7;
  --line: #eff2f5;
  --primary: #4e73df;
  --primary-dark: #7a94e8;
  --primary-btn: #4e73df;
  --primary-btn-fg: #fff;
  --primary-btn-hover: #3b5cc9;
  --danger: #f1416c;
  --aside-w: 220px;
  --aside-mini-w: 48px;
  --header-h: 64px;
  --ctrl-h: 32px;
  --ctrl-radius: 6px;
  --ctrl-border: #e4e6ef;
  --radius: 12px;
  --shadow: 0 0 20px 0 rgba(76, 87, 125, 0.08);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--page);
}
body { overflow: hidden; height: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
code { font-size: 12px; background: #f1f3f8; padding: 1px 6px; border-radius: 4px; }

/* Login */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f5f8fa 0%, #eef3f7 100%);
  padding: 24px;
}
.login-card {
  width: 400px;
  max-width: 100%;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 36px 32px;
}
.login-logo {
  display: block;
  max-width: 180px;
  max-height: 50px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 8px;
}
.login-card label {
  display: block;
  margin: 16px 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: #3f4254;
}
.login-card input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--ctrl-border);
  border-radius: var(--ctrl-radius);
  background: #fff;
  color: var(--text);
  font: inherit;
}
.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.18);
}
.login-card .chk { margin-top: 14px; }
.error { color: var(--danger); min-height: 1.2em; font-size: 13px; margin: 10px 0 0; }

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.btn-primary {
  margin-top: 0;
  height: var(--ctrl-h);
  padding: 0 12px;
  border: 1px solid var(--primary-btn);
  border-radius: 6px;
  background: var(--primary-btn);
  color: var(--primary-btn-fg);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.login-card .btn-primary { margin-top: 20px; height: 44px; font-size: 14px; }

/* Multi jak Chosen w WWW (chipy + lista zostaje otwarta, checkmark) */
.mpick-src { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.mpick { position: relative; width: 100%; min-width: 180px; font-size: 13px; z-index: 1; }
.mpick.is-open { z-index: 80; }
.mpick-box {
  min-height: 36px; padding: 5px 28px 5px 8px; border: 1px solid #d1d5db; border-radius: 6px;
  background: #fff; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; cursor: text;
}
.mpick.is-open .mpick-box { border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.35); }
.mpick::after {
  content: ""; position: absolute; right: 12px; top: 16px; border: 5px solid transparent; border-top-color: #9ca3af; pointer-events: none;
}
.mpick-ph { color: #6b7280; }
.mpick-q {
  border: 0; outline: none; flex: 1; min-width: 80px; height: 24px; font: inherit; font-size: 13px; background: transparent;
}
.mpick-chip {
  position: relative; display: inline-block; margin: 0; padding: 3px 22px 3px 8px;
  background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 4px; color: #374151; font-size: 12px; line-height: 16px;
}
.mpick-x {
  position: absolute; right: 4px; top: 2px; border: 0; background: none; cursor: pointer; color: #9ca3af; font-size: 14px; line-height: 1;
}
.mpick-drop {
  display: none; position: absolute; left: 0; right: 0; top: 100%; margin-top: 2px;
  background: #fff; border: 1px solid #5897fb; border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.18);
  max-height: 280px; overflow: auto; z-index: 90;
}
.mpick.is-open .mpick-drop { display: block; }
.mpick-opt {
  display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 28px 7px 10px;
  font: inherit; font-size: 13px; cursor: pointer; position: relative;
}
.mpick-opt:hover { background: #f3f4f6; }
.mpick-opt.on { background: #e6f4ff; color: #1677ff; }
.mpick-opt.on:hover { background: #bae0ff; color: #0958d9; }
.mpick-opt.on::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 5px; height: 10px; margin-top: -7px;
  border: solid #1677ff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.mpick-empty { padding: 10px; color: #6b7280; font-size: 13px; }
.form-grid .mpick { min-width: 0; }
.modal-card { overflow: visible; }
.modal-card .mpick.is-open { z-index: 90; }
.flt-row:has(.mpick.is-open) { z-index: 70; position: relative; }

.flt-wrap { position: relative; }
.flt-pop {
  position: absolute; right: 0; top: calc(100% + 6px); width: 420px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 12px 40px rgba(15,23,42,.16);
  padding: 12px; z-index: 200; overflow: visible;
}
.flt-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 600; font-size: 13px; }
.flt-head button { border: 0; background: none; color: var(--primary); cursor: pointer; font: inherit; font-size: 13px; }
.flt-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: start; margin-bottom: 10px; }
.flt-type { font-size: 12px; font-weight: 600; color: #6b7280; padding-top: 10px; }
.flt-badge {
  display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; align-items: center; justify-content: center;
}
.flt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #e4e6ef;
  border-radius: 6px;
  background: #fff;
  color: #3f4254;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.flt-btn:hover {
  background: #f9f9f9;
  border-color: #b5b5c3;
}
.flt-btn.has-filters {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
}
.flt-btn-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M3 5h18l-7 8v5l-4 2v-7L3 5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M3 5h18l-7 8v5l-4 2v-7L3 5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.btn-primary:hover { background: var(--primary-btn-hover); border-color: var(--primary-btn-hover); color: var(--primary-btn-fg); }
.btn-danger {
  margin-top: 8px;
  height: var(--ctrl-h);
  padding: 0 12px;
  border: 1px solid #b91c1c;
  border-radius: 6px;
  background: #dc2626;
  color: #fff;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-danger:hover { background: #b91c1c; }
.btn-danger:disabled { opacity: 0.6; cursor: default; }
.settings-danger {
  border-color: #fecaca;
  background: #fff7f7;
}
.settings-danger h3 { color: #991b1b; }
.btn-ghost {
  height: var(--ctrl-h);
  padding: 0 12px;
  border: 1px solid var(--ctrl-border);
  border-radius: 6px;
  background: #fff;
  color: #3f4254;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.btn-ghost:hover { background: #f9f9f9; }

/* Shell */
.shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
}
.aside {
  width: var(--aside-w);
  flex-shrink: 0;
  background: var(--aside);
  color: var(--aside-text);
  display: flex;
  flex-direction: column;
  z-index: 30;
  border-right: 1px solid var(--line);
}
.aside-brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 12px;
  border-bottom: 1px solid var(--line);
}
.aside-logo {
  max-height: 50px;
  height: auto;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  object-position: left center;
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  margin-left: 10px;
}
.aside-mini-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: #7e8299;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.aside-mini-btn:hover { background: var(--aside-hover); color: #181c32; }
.aside-mini-btn svg { width: 18px; height: 18px; }
.aside-brand-text {
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.aside-nav {
  flex: 1;
  overflow: auto;
  padding: 16px 16px 24px;
}
.aside-heading {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a1a5b7;
  padding: 16px 12px 8px;
}
.aside-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: var(--aside-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.aside-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}
.aside-link:hover {
  background: var(--aside-hover);
  color: #181c32;
}
.aside-link.on {
  background: #eef3ff;
  color: var(--aside-active);
  box-shadow: inset 3px 0 0 var(--aside-active);
}
.fk_page[hidden] { display: none !important; }
.fk_page.is-on { display: block; }
#fkKsefMsg.error { color: #b42318; }
.aside-parent {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--aside-text);
  text-align: left;
}
.aside-parent:hover { background: var(--aside-hover); color: #181c32; }
.aside-parent.on {
  background: #eef3ff;
  color: var(--aside-active);
  box-shadow: inset 3px 0 0 var(--aside-active);
}
.aside-parent-label { flex: 1; min-width: 0; }
.aside-chevron {
  width: 14px;
  height: 14px;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.15s ease;
}
.aside-group.is-open .aside-chevron { transform: rotate(90deg); }
.aside-subs { display: none; }
.aside-group.is-open .aside-subs { display: block; }
.aside-sub {
  display: block;
  margin: 0 12px 2px 44px;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--aside-text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}
.aside-sub:hover { background: var(--aside-hover); color: #181c32; }
.aside-sub.on {
  background: #eef3ff;
  color: var(--aside-active);
}

.wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--page);
}
.header {
  height: var(--header-h);
  background: var(--header);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  box-shadow: 0 10px 30px 0 rgba(82, 63, 105, 0.05);
  z-index: 10;
}
.header-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  flex: 1;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-wrap { position: relative; }
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.user-avatar:hover { filter: brightness(1.06); }
.user-avatar[aria-expanded="true"] { box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.25); }
.user-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.user-avatar-img[hidden] { display: none !important; }
.user-avatar.has-photo #userInitials[hidden] { display: none !important; }
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(24, 28, 50, 0.18);
  padding: 8px;
  z-index: 50;
}
.user-menu-head {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.user-menu-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.user-menu-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  word-break: break-word;
}
.user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 10px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.user-menu button:hover { background: #f5f8fa; }
.user-menu-danger { color: var(--danger) !important; }
.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: #7e8299;
  display: none;
  align-items: center;
  justify-content: center;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: #f1f1f2; }

.content {
  flex: 1;
  overflow: auto;
  /* Jedyny inset stron listowych (#calendar, #tasks, #timesheet, #gantt, listy…).
     Profile / obciążenie: content padding=0, ten sam 12/16 na shellu. */
  padding: 12px 16px 24px;
}
.page { max-width: none; }
.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
}
.settings-stack-wide { max-width: none; }
.settings-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
}
.settings-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.settings-card .form-grid { margin-bottom: 12px; }
.settings-card .table { margin: 0 0 12px; }
.settings-card .muted { margin: 0 0 12px; }
.org-logo-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.org-logo-preview-wrap {
  position: relative;
  width: 180px;
  height: 50px;
  border: 1px dashed #cdd2de;
  border-radius: 8px;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 8px;
  box-sizing: border-box;
  overflow: hidden;
}
.org-logo-preview {
  max-width: 180px;
  max-height: 50px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
  display: block;
}
.org-logo-actions { flex: 1 1 200px; min-width: 180px; }
.org-logo-actions .muted { margin-top: 10px; }

/* Koszty wspólne */
.kw-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
}
.kw-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 24px;
}
.kw-toolbar-right { display: flex; gap: 8px; }
.kw-toolbar label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.kw-toolbar input[type="number"] {
  width: 100px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.kw-typ {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
.kw-typ legend {
  font-size: 13px;
  color: var(--muted);
  padding: 0;
  margin: 0 0 4px;
  width: 100%;
}
.kw-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
}
.kw-summary > div { display: flex; flex-direction: column; gap: 4px; }
.kw-summary strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.kw-hint { margin: 0; font-size: 12px; line-height: 1.45; }
.kw-hint code { font-size: 11px; }
.kw-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 4px;
}
.kw-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: -1px;
}
.kw-tab:hover { color: var(--text); }
.kw-tab.on {
  color: var(--text);
  border-bottom-color: #2563eb;
}
.kw-tab-body { display: flex; flex-direction: column; gap: 16px; }
.kw-budget-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.kw-budget-table input[type="number"] {
  width: 100%;
  max-width: 140px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  text-align: right;
}
.kw-toolbar-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
}
.kw-stawka-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .kw-stawka-layout { grid-template-columns: 1fr; }
}
.kw-year-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: #f7f9fc;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.kw-year-box > div { display: flex; flex-direction: column; gap: 2px; }
.kw-year-box strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.kw-table tr.kw-wynik-row th,
.kw-table tr.kw-wynik-row td,
.kw-budget-table tr.kw-wynik-row th,
.kw-budget-table tr.kw-wynik-row td {
  background: #6c757d;
  color: #c5dfeb;
}
.kw-table tr.kw-wynik-row th:first-child { background: #6c757d; color: #c5dfeb; }
.kw-table tr.kw-cum th,
.kw-table tr.kw-cum td { color: #0060a0; }
.kw-scroll { overflow-x: auto; }
.kw-table { min-width: 1100px; font-size: 12px; }
.kw-table th, .kw-table td { padding: 6px 8px; white-space: nowrap; }
.kw-table th:first-child, .kw-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--card);
  min-width: 220px;
  z-index: 1;
}
.kw-table thead th { text-align: right; background: #6c757d; color: #fff; }
.kw-table thead th:first-child { background: #6c757d; color: #fff; }
.kw-table td.num, .kw-table .kw-sum { text-align: right; font-variant-numeric: tabular-nums; }
.kw-table tr.kw-strong th, .kw-table tr.kw-strong td { font-weight: 600; }
.kw-table tr.kw-strong:not(.kw-wynik-row) th:first-child,
.kw-table tr.kw-strong:not(.kw-wynik-row) td { background: #f7f9fc; }

/* Import Norma */
.norma-shell { max-width: 1100px; }
.norma-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.norma-title {
  margin: 0;
  flex: 1 1 auto;
  font-size: 18px;
  font-weight: 600;
}
.norma-status {
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef3ff;
  color: #3f4254;
  font-size: 13px;
  margin-bottom: 12px;
}
.norma-status.is-error { background: #fff5f8; color: var(--danger, #f1416c); }
.norma-status.is-ok { background: #e8fff3; color: #0a7a3e; }
.norma-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px 18px;
  margin-bottom: 14px;
}
.norma-card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
}
.norma-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 14px;
}
.norma-field label {
  display: block;
  font-size: 11px;
  color: var(--muted, #7e8299);
  margin-bottom: 4px;
}
.norma-field input,
.norma-field select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border, #e4e6ef);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  background: #fff;
}
.norma-field input[readonly] { background: #f9f9fb; color: #5e6278; }
.norma-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}
.norma-file { position: relative; overflow: hidden; display: inline-flex; align-items: center; cursor: pointer; }
.norma-file input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.norma-table-wrap { max-height: min(70vh, 720px); overflow: auto; }
.norma-table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.norma-table-head h3 { margin: 0; }
.norma-table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.norma-seg {
  display: inline-flex;
  border: 1px solid var(--border, #e4e6ef);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.norma-seg-btn {
  border: 0;
  background: transparent;
  color: #7e8299;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.norma-seg-btn + .norma-seg-btn { border-left: 1px solid var(--border, #e4e6ef); }
.norma-seg-btn.is-on {
  background: #eef3ff;
  color: #0050b3;
  font-weight: 600;
}
.norma-dzial td {
  background: #f1f3f8;
  font-weight: 600;
  color: #3f4254;
}
.norma-table tr.norma-rms td { color: #5e6278; }
.norma-table tr.norma-rms td:nth-child(2),
.norma-table tr.norma-rms td:nth-child(3) { padding-left: 18px; }
.norma-table.is-flat th { font-size: 10px; white-space: nowrap; }
.norma-table.is-flat td { font-size: 11px; }
.data-table th.num,
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  min-height: var(--ctrl-h);
  overflow: visible;
  position: relative;
  z-index: 4;
  flex-wrap: wrap;
}
.page-head > .btn-primary,
.page-head > .btn-ghost { flex: 0 0 auto; margin-top: 0; }
.page-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 auto;
  min-width: 0;
}
.page-head-left > .btn-primary,
.page-head-left > .btn-ghost { flex: 0 0 auto; margin-top: 0; }
.page-head .www-tabs { margin: 0; border-bottom: 0; }
a.doc-link {
  color: #4e73df;
  text-decoration: none;
  font-weight: 500;
}
a.doc-link:hover { text-decoration: underline; }

.card-list { display: grid; gap: 12px; }
.item {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.item b { display: block; font-size: 15px; margin-bottom: 4px; }
.item small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin: -2px 0 4px; }
.item span { color: var(--muted); font-size: 13px; }

.empty-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.empty-card h3 { margin: 0 0 8px; }
.empty-card p { margin: 0; color: #7e8299; line-height: 1.55; }

.aside-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 25;
}

@media (max-width: 991px) {
  body { overflow: auto; }
  .icon-btn { display: inline-flex; }
  .aside {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .shell.aside-open .aside { transform: none; }
  .shell.aside-open .aside-backdrop { display: block; }
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
@media (max-width: 900px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
}
.stat b { display: block; font-size: 26px; margin-top: 6px; }
.stat span { font-size: 13px; color: var(--muted); }
.head-actions { display: flex; gap: 8px; align-items: center; }
.head-actions select, .page-head select {
  height: var(--ctrl-h);
  border: 1px solid var(--ctrl-border);
  border-radius: var(--ctrl-radius);
  padding: 0 10px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  min-width: 160px;
  color: var(--text);
}
.head-actions select:focus, .page-head select:focus,
.head-actions input[type="date"]:focus, .page-head input[type="date"]:focus,
.search:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.16);
}
.head-date-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.head-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.head-actions input[type="date"],
.page-head input[type="date"] {
  height: var(--ctrl-h);
  border: 1px solid var(--ctrl-border);
  border-radius: var(--ctrl-radius);
  padding: 0 10px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  width: 10.5rem;
  min-width: 0;
}
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}
.scroll-x { overflow-x: auto; }
.item { cursor: pointer; }
.item:hover { outline: 1px solid #dbe4ec; }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f3f8;
  color: #5e6278;
  margin-right: 6px;
}
.badge.ok { background: #e8fff3; color: #50cd89; }
.badge.warn { background: #fff8dd; color: #ffc700; }
.badge.run { background: #e0e7ff; color: #3730a3; }
.item-actions { float: right; display: flex; gap: 6px; }
.item-actions button { margin: 0; height: var(--ctrl-h); padding: 0 12px; font-size: 13px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(24, 28, 50, 0.45);
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow: auto;
}
.modal-card {
  width: 560px;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}
.modal-card h3 { margin: 0 0 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.modal-actions .btn-primary { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-size: 12px; font-weight: 600; color: #5e6278; margin-bottom: 4px; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
  height: var(--ctrl-h);
  border: 1px solid var(--ctrl-border);
  border-radius: var(--ctrl-radius);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: #fff;
}
.form-grid textarea { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; }
.kh-lookup-row {
  display: flex;
  gap: 6px;
  align-items: center;
  width: 100%;
}
.kh-lookup-row input { flex: 1 1 auto; min-width: 0; }
.kh-lookup-btn {
  flex: 0 0 auto;
  height: var(--ctrl-h);
  padding: 0 10px;
  border: 1px solid #c5d4f7;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e3a8a;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.kh-lookup-btn:hover:not(:disabled) { background: #dbeafe; }
.kh-lookup-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.form-grid .kh-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}
.form-grid label.chk,
.form-grid label.embz-param-chk {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 500;
  color: #5e6278;
  cursor: pointer;
  user-select: none;
}
.form-grid label.chk input[type="checkbox"],
.form-grid label.embz-param-chk input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  margin: 0;
  accent-color: var(--primary, #009ef7);
  cursor: pointer;
  flex-shrink: 0;
}
.form-grid .chk input { height: auto; width: auto; }
.form-grid input:disabled, .form-grid select:disabled {
  background: #f4f5f8;
  color: #5e6278;
  cursor: not-allowed;
}

.gantt { min-width: 700px; }
.gantt-head, .gantt-row { display: flex; align-items: center; }
.gantt-lab { width: 220px; flex-shrink: 0; font-size: 12px; padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-track { flex: 1; position: relative; height: 28px; background: #f5f8fa; border-bottom: 1px solid #eef2f6; }
.gantt-bar {
  position: absolute;
  top: 6px;
  height: 16px;
  border-radius: 4px;
  background: #009ef7;
  min-width: 4px;
}
.gantt-bar.st-oprac { background: #ffc700; }
.gantt-bar.st-real { background: #009ef7; }
.gantt-bar.st-zak { background: #50cd89; }
.gantt-scale { display: flex; font-size: 10px; color: var(--muted); padding-left: 220px; gap: 0; }
.gantt-scale span { flex: 1; text-align: center; }

.occ-table { border-collapse: collapse; font-size: 12px; min-width: 800px; }
.occ-table th, .occ-table td { border: 1px solid #eef2f6; padding: 6px 8px; text-align: center; }
.occ-table th { background: #f5f8fa; font-weight: 600; }
.occ-table td.name { text-align: left; white-space: nowrap; font-weight: 500; }
.occ-legend { margin: -8px 0 12px; }
.cell-hot { background: #f1416c22; }
.cell-mid { background: #ffc70033; }
.cell-ok { background: #50cd8922; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid #f3f5f8; }

.seg { display: flex; background: #f5f8fa; border-radius: 8px; padding: 3px; gap: 2px; height: var(--ctrl-h); box-sizing: border-box; }
.seg-btn {
  border: 0; background: transparent; height: 100%; padding: 0 12px; border-radius: 6px;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.seg-btn.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }

/* Umowy (profil / projekt): Przychód / Koszt — jasnozielony pastel */
#umKatSwitch,
#prpUmKat {
  background: #e8f5eb;
  border: 1px solid #d4ebda;
}
#umKatSwitch .seg-btn,
#prpUmKat .seg-btn {
  color: #5a7d64;
}
#umKatSwitch .seg-btn.on,
#prpUmKat .seg-btn.on {
  background: #c8e9d0;
  color: #1f6b3a;
  box-shadow: 0 1px 2px rgba(31, 107, 58, 0.12);
}
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #5e6278; white-space: nowrap; }
.chk input { width: auto; }
.inv-view-opt.hidden { display: none !important; }
.cal-label { font-weight: 600; min-width: 140px; text-align: center; }
.prp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) { .prp-stats { grid-template-columns: 1fr 1fr; } }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #eef2f6; border: 1px solid #eef2f6; border-radius: 8px; overflow: hidden; }
.cal-dow { background: #f5f8fa; font-size: 11px; font-weight: 600; color: var(--muted); padding: 8px; text-align: center; }
.cal-cell { background: #fff; min-height: 92px; padding: 6px; font-size: 11px; }
.cal-cell.out { background: #fafbfc; color: #c0c4d0; }
.cal-cell .d { font-weight: 700; margin-bottom: 4px; }
.cal-cell.today { outline: 2px solid var(--primary); outline-offset: -2px; }
.cal-ev { display: block; background: #e1f0ff; color: #009ef7; border-radius: 4px; padding: 1px 4px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cal-ev.obc { background: #e8fff3; color: #50cd89; }
.week-grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.week-grid th, .week-grid td { border: 1px solid #eef2f6; padding: 8px; text-align: center; }
.week-grid th { background: #f5f8fa; }
.week-grid td.name { text-align: left; font-weight: 500; white-space: nowrap; }
.week-h { font-weight: 700; }
.comments { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.comment { font-size: 13px; padding: 8px 0; border-bottom: 1px solid #f3f5f8; }
.comment .muted { display: block; font-size: 11px; }
.modal-card.wide { width: 720px; }
.modal-card.xl { width: 980px; }
.modal-card.xl #modalBody { max-height: calc(100vh - 220px); overflow: auto; padding-right: 4px; }
.form-grid.cols3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 720px) {
  .form-grid.cols3 { grid-template-columns: 1fr 1fr; }
}
.umowa-form .form-sec {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  padding-top: 14px;
  border-top: 1px solid #eef2f6;
  font-size: 13px;
  font-weight: 700;
  color: #181c32;
}
.umowa-form .form-sec:first-child { border-top: 0; padding-top: 0; }
.umowa-form .hint { font-size: 11px; font-weight: 500; color: #a1a5b7; margin-top: 4px; }
.umowa-form .vat-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.umowa-form .vat-table th {
  text-align: left; color: #5e6278; font-weight: 600; padding: 4px 4px 6px; font-size: 11px;
}
.umowa-form .vat-table td { padding: 3px 4px; }
.umowa-form .vat-table .nr { width: 28px; color: #a1a5b7; font-weight: 600; }
.umowa-form .vat-table input,
.umowa-form .vat-table select {
  width: 100%; height: var(--ctrl-h); border: 1px solid var(--ctrl-border);
  border-radius: var(--ctrl-radius); padding: 0 8px; font: inherit; font-size: 13px;
  color: var(--text); background: #fff;
}
.umowa-form .totals {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 8px;
}
.umowa-form .tot {
  background: #f5f8fa; border-radius: 8px; padding: 8px 10px;
}
.umowa-form .tot label { display: block; font-size: 11px; font-weight: 600; color: #5e6278; margin-bottom: 2px; }
.umowa-form .tot b { font-size: 14px; }
.umowa-form .kh-preview {
  font-size: 12px; color: #5e6278; line-height: 1.5; min-height: 1.5em;
}
.umowa-form .child-card {
  border: 1px solid #eef2f6; border-radius: 10px; padding: 12px; margin-bottom: 8px; background: #fafbfc;
}
.umowa-form .child-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
  font-size: 12px; font-weight: 700;
}
.umowa-form .addr-box.hidden { display: none; }
.umowa-form .godz-box.hidden { display: none; }
.um-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 32px;
  align-items: start;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 8px;
  padding: 16px 18px 20px;
}
@media (max-width: 980px) {
  .um-cols { grid-template-columns: 1fr; }
}
.umowa-form .um-col { min-width: 0; }
.umowa-form .um-block { margin-bottom: 14px; }
.umowa-form .um-sec {
  font-size: 15px;
  font-weight: 600;
  color: #181c32;
  padding: 0 0 8px;
  margin: 0 0 12px;
  border-bottom: 1px solid #cfd3df;
  background: transparent;
}
.umowa-form .um-sec-body { display: flex; flex-direction: column; gap: 10px; }
.umowa-form .um-sec-plain { padding-top: 0; }
.umowa-form .um-field { min-width: 0; }
.umowa-form .um-field > label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #181c32;
  margin-bottom: 4px;
}
.umowa-form .um-field input,
.umowa-form .um-field select,
.umowa-form .um-repr-row input {
  width: 100%;
  height: var(--ctrl-h);
  border: 1px solid var(--ctrl-border);
  border-radius: var(--ctrl-radius);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: #fff;
}
.umowa-form .um-field input[type="checkbox"] {
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  box-shadow: none;
}
.umowa-form .um-field input:focus,
.umowa-form .um-field select:focus,
.umowa-form .um-repr-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.16);
}
.umowa-form .um-field input[readonly] { background: #f4f5f8; color: #5e6278; }
.umowa-form .um-field.kh-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
}
.umowa-form .um-field.kh-flags > label { margin-bottom: 0; font-weight: 500; color: #3f4254; }
.umowa-form .um-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.umowa-form .vat-table { margin-top: 4px; }
.umowa-form .vat-table thead th {
  background: #fafbfc;
  color: #7e8299;
  font-weight: 600;
  font-size: 11px;
  padding: 10px 8px;
  border-bottom: 1px solid #eef0f4;
}
.umowa-form .vat-table thead th:first-child { border-radius: 0; }
.umowa-form .um-sums { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.umowa-form .um-sums-sub {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #eef2f6;
}
.umowa-form .um-sum label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #181c32;
  margin-bottom: 4px;
}
.umowa-form .um-sum-val {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--ctrl-h);
  padding: 0 10px;
  border: 1px solid var(--ctrl-border);
  border-radius: var(--ctrl-radius);
  background: #f9fafb;
  font-size: 13px;
}
.umowa-form .um-sum-val b { font-size: 13px; font-weight: 600; }
.umowa-form .um-sum-val span { color: #5e6278; font-size: 12px; }
.umowa-form .um-pay {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid #e4e6ef;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.umowa-form .um-repr-box {
  border: 1px solid var(--ctrl-border);
  border-radius: var(--ctrl-radius);
  padding: 8px 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.umowa-form .um-repr-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px;
  align-items: center;
}
.umowa-form .um-repr-row span {
  font-size: 12px;
  color: #5e6278;
}
@media (max-width: 520px) {
  .umowa-form .um-repr-row { grid-template-columns: 1fr; gap: 2px; }
}
.umowa-form .um-podzial {
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 8px;
  padding: 16px 18px 20px;
}
.umowa-form .um-podzial-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.umowa-form .um-kind {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 0;
  margin: 0;
}
.umowa-form .um-kat-seg {
  width: fit-content;
  max-width: 100%;
  height: auto;
  min-height: var(--ctrl-h);
}
.umowa-form .um-kat-hint {
  margin-top: 6px;
  line-height: 1.35;
}
.umowa-form .um-kind-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: #3f4254;
  white-space: nowrap;
  line-height: 1.2;
}
.umowa-form .um-kind-opt input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #3148a8;
}
.umowa-form .um-combo {
  position: relative;
  z-index: 1;
}
.umowa-form .um-combo.is-open {
  z-index: 120;
}
.umowa-form .um-combo-inline {
  min-width: 160px;
}
.umowa-form .um-combo-q {
  width: 100%;
}
.umowa-form .um-split-pick {
  display: flex;
  gap: 8px;
  align-items: center;
}
.umowa-form .um-split-pick .um-combo {
  flex: 1;
}
.umowa-form .um-combo-list {
  position: absolute;
  z-index: 130;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid #e4e6ef;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(24, 28, 50, 0.12);
  padding: 4px;
}
.umowa-form tr:has(.um-combo.is-open),
.umowa-form td:has(.um-combo.is-open),
.umowa-form .um-field:has(.um-combo.is-open),
.umowa-form .um-split-pick:has(.um-combo.is-open) {
  position: relative;
  z-index: 110;
}
.umowa-form .um-podzial:has(.um-combo.is-open),
.umowa-form .um-block:has(.um-combo.is-open) {
  position: relative;
  z-index: 100;
  overflow: visible;
}
.umowa-form .um-combo-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  color: #181c32;
  cursor: pointer;
}
.umowa-form .um-combo-item:hover { background: #f1f3f8; }
.umowa-form .um-combo-empty {
  padding: 10px;
  font-size: 12px;
  color: #a1a5b7;
}
.umowa-form .um-link {
  border: 0;
  background: none;
  padding: 0;
  color: #0060a0;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.umowa-form .um-link:hover { text-decoration: underline; }
.umowa-form .um-split-wrap {
  overflow-x: auto;
  overflow-y: visible;
}
.umowa-form .um-split-wrap:has(.um-combo.is-open) {
  overflow: visible;
}
.umowa-form .um-split .nr {
  width: 28px;
  color: #7e8299;
  font-weight: 600;
  font-size: 12px;
}
.umowa-form .um-split-pick {
  display: flex;
  gap: 8px;
  align-items: center;
}
.umowa-form .um-split .s-ref { flex: 1; min-width: 160px; }
.umowa-form .um-split input,
.umowa-form .um-split select {
  width: 100%;
  height: var(--ctrl-h);
  border: 1px solid var(--ctrl-border);
  border-radius: var(--ctrl-radius);
  padding: 0 8px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: #fff;
}
.umowa-form .um-split input[readonly] { background: #f4f5f8; color: #5e6278; }
.umowa-form .um-split tfoot td {
  font-weight: 600;
  border-top: 1px solid #eef0f4;
  background: #fafbfc;
  color: #3f4254;
}
.umowa-form #umAddSplit,
.umowa-form #fkAddSplit { margin-top: 10px; }
.um-kpi {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 720px) {
  .um-kpi { grid-template-columns: 1fr; }
}
#umErr { margin: 0 0 8px; }
#umBody { padding-bottom: 24px; }
.badge.layer { background: #f8f5ff; color: #7239ea; }
.add-wrap { position: relative; }
.add-wrap .btn-primary { margin-top: 0; height: var(--ctrl-h); }
.add-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px;
  background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(24,28,50,.18);
  padding: 8px; z-index: 40;
}
.add-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 10px 12px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer;
}
.add-menu button:hover { background: #f5f8fa; }
.head-actions.wrap { flex-wrap: wrap; justify-content: flex-end; }
.search {
  height: var(--ctrl-h); border: 1px solid var(--ctrl-border); border-radius: var(--ctrl-radius); padding: 0 12px;
  font: inherit; font-size: 13px; min-width: 180px; background: #fff; color: var(--text);
}
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.kanban-col { background: #f5f8fa; border-radius: 12px; padding: 10px; min-height: 140px; }
.kanban-col h4 { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.kanban-card {
  background: #fff; border-radius: 8px; padding: 10px; margin-bottom: 8px;
  box-shadow: var(--shadow); cursor: grab; font-size: 13px;
}
.kanban-card b { display: block; margin-bottom: 4px; }
.kanban-col.drag { outline: 2px dashed var(--primary); }
.group-h { font-size: 13px; font-weight: 700; margin: 18px 0 8px; color: #5e6278; }
.occ-table td[data-emp] { cursor: pointer; }
.occ-table td[data-emp]:hover { filter: brightness(0.96); }
.search-wrap { position: relative; }
.search-hits {
  position: absolute; top: calc(100% + 6px); right: 0; width: 360px; max-height: 360px; overflow: auto;
  background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(24,28,50,.18); padding: 8px; z-index: 45;
}
.search-hits button {
  display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px;
  border-radius: 8px; font: inherit; cursor: pointer;
}
.search-hits button:hover { background: #f5f8fa; }
.search-group { font-size: 11px; font-weight: 700; color: var(--muted); padding: 8px 10px 4px; text-transform: uppercase; }
.gantt-bar { cursor: ew-resize; }
.week-grid td[data-day] { cursor: pointer; }

.www-tabs {
  display: flex;
  border-bottom: 1px solid #eef0f4;
  margin: 0 0 10px;
  gap: 0;
}
.www-tab {
  appearance: none; border: 0; background: transparent;
  height: var(--ctrl-h); padding: 0 14px; font: inherit; font-size: 13px; font-weight: 500;
  color: #5e6278; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.www-tab:hover { color: #3f4254; }
.www-tab.on { color: var(--primary); border-bottom-color: var(--primary); }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; color: #3f4254; }
.data-table th {
  text-align: left; font-size: 11px; font-weight: 600; color: #7e8299;
  padding: 8px 10px; border-bottom: 1px solid #eef0f4; background: #fafbfc; white-space: nowrap;
}
.data-table td { padding: 9px 10px; border-bottom: 1px solid #f3f5f8; vertical-align: top; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr.um-group-row,
.data-table tbody tr.um-group-row:hover {
  cursor: default;
  background: #f5f8fa;
}
.data-table .um-group-row td {
  padding: 0;
  border-bottom: 1px solid #e4e6ef;
  font-size: 13px;
}
.um-group-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.um-group-toggle:hover { background: #eef3f8; }
.um-group-row.um-group-depth-1 .um-group-toggle { padding-left: 28px; }
.um-group-row.um-group-depth-2 .um-group-toggle { padding-left: 44px; }
.um-group-row.um-group-depth-3 .um-group-toggle { padding-left: 60px; }
.um-group-chevron {
  flex: 0 0 auto;
  box-sizing: content-box;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #5e6278;
  transform: rotate(-90deg);
  transition: transform 0.15s ease;
}
.um-group-row:not(.is-collapsed) .um-group-chevron { transform: rotate(0deg); }
.um-group-label { font-weight: 700; color: #181c32; }
.um-group-count {
  display: inline-block;
  margin-left: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e4e6ef;
  color: #5e6278;
  font-size: 11px;
  font-weight: 600;
}
.um-tree-btns {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.um-tree-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #e4e6ef;
  border-radius: 6px;
  background: #fff;
  color: #5e6278;
  cursor: pointer;
}
.um-tree-btn:hover {
  background: #f9f9f9;
  border-color: #b5b5c3;
}
.um-tree-btn svg {
  width: 14px;
  height: 14px;
  display: block;
}
.um-view-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #cfe2ff;
  border-radius: 8px;
  background: #eaf3ff;
}
.um-view-btn {
  border: 0;
  background: transparent;
  color: #3b6ea5;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.um-view-btn:hover {
  background: rgba(255, 255, 255, 0.55);
  color: #1e4f8c;
}
.um-view-btn.on {
  background: #fff;
  color: #1e4f8c;
  box-shadow: 0 1px 2px rgba(30, 79, 140, 0.12);
}
.tzr-status {
  font-size: 13px;
  color: var(--muted, #6c757d);
  margin: 0 0 8px;
  min-height: 1.2em;
}
.tzr-status.is-error { color: #b42318; }
#tzrList .tzr-table { width: 100%; }
#tzrList .tzr-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
#tzrList .tzr-sum { font-weight: 700; }
#tzrList .tzr-group-row td {
  background: #f4f6f9;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  padding: 8px 12px;
  border-bottom: 1px solid #e4e7ec;
}
#tzrList .tzr-group-row.tzr-depth-2 td { background: #fafbfc; font-weight: 600; }
#tzrList .tzr-group-row.tzr-depth-3 td { background: #fcfcfd; font-weight: 600; }
#tzrList .tzr-group-row:hover td { background: #eef1f6; }
#tzrList .tzr-indent {
  display: inline-block;
  width: 14px;
  vertical-align: middle;
}
#tzrList .tzr-group-row td:first-child::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 8px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #667085;
  vertical-align: middle;
  transition: transform 0.12s ease;
}
#tzrList .tzr-group-row.is-collapsed td:first-child::before { transform: rotate(-90deg); }
#tzrList .tzr-leaf .tzr-cat-col { color: #98a2b3; font-size: 12px; }
#tzrViewModes[hidden] { display: none !important; }
#tzrMonthNav[hidden] { display: none !important; }

#tab-trash .trash-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
#tab-trash .trash-status {
  font-size: 13px;
  color: var(--muted, #6c757d);
  margin: 0 0 8px;
  min-height: 1.2em;
}
#tab-trash .trash-status.is-error { color: #b42318; }
#tab-trash .trash-sel-count {
  font-size: 13px;
  color: #3b6ea5;
  font-weight: 600;
  align-self: center;
}
#trashTable {
  width: 100%;
  border-collapse: collapse;
}
#trashTable thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9f9f9;
  font-weight: 600;
  font-size: calc(11px + 2pt);
  color: #7e8299;
  text-align: left;
  padding: 8px 8px;
  border-bottom: 1px solid #eff2f5;
  white-space: nowrap;
}
#trashTable tbody td,
#trashTable tfoot td {
  padding: 6px 8px;
  border-bottom: 1px solid #f4f6f8;
  vertical-align: middle;
  font-size: 10pt;
  color: #3f4254;
}
#trashTable tbody tr.trash-row {
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}
#trashTable tbody tr.trash-row:hover td {
  background: #f9f9f9;
}
#trashTable tbody tr.trash-row.embz-selected td {
  background: #dbeafe !important;
}
#trashTable tbody tr.trash-row.embz-selected:hover td {
  background: #bfdbfe !important;
}
#trashTable .trash-empty {
  text-align: center;
  color: var(--muted, #6c757d);
  padding: 24px 12px !important;
}
#trashTable thead th.trash-sort-th {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
#trashTable thead th.trash-sort-th:hover {
  color: #3f4254;
}
#trashTable thead th.trash-sort-th.is-sorted {
  color: #1e4f8c;
}
#trashTable .trash-doc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
#trashTable .trash-form-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #7e8299;
}
#trashTable .trash-doc-detail {
  font-size: 10pt;
  color: #3f4254;
  word-break: break-word;
}
#trashTable .trash-col-project { white-space: nowrap; }
#trashTable .trash-col-date {
  width: 148px;
  white-space: nowrap;
}
#trashTable .trash-col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}
#trashTable .trash-row-btn {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  margin-left: 6px;
}
#trashTable .trash-row-btn:first-child { margin-left: 0; }

.tzr-month-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.tzr-month-label {
  min-width: 9.5rem;
  font-weight: 600;
  cursor: default;
}
#tab-contracts.ctr-fs-open {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2000 !important;
  display: flex !important;
  flex-direction: column;
  margin: 0 !important;
  padding: 16px 20px 12px !important;
  background: #fff;
  overflow: hidden;
}
#tab-contracts.ctr-fs-open .page-head { flex: 0 0 auto; margin-bottom: 10px; }
#tab-contracts.ctr-fs-open #ctrList {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}
body.ctr-fs-open { overflow: hidden !important; }
.table-wrap {
  background: #fff; border-radius: 8px; border: 1px solid #eef0f4; overflow: auto;
}

.gantt-www { overflow: auto; background: #fff; border: 1px solid #eef0f4; border-radius: 8px; font-size: 12px; }
.gantt-www-scale { display: flex; position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 1px solid #e4e6ef; }
.gantt-www-lab {
  width: 260px; flex-shrink: 0; position: sticky; left: 0; z-index: 1;
  background: #fff; padding: 4px 8px; border-right: 1px solid #eef0f4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gantt-www-scale .gantt-www-lab { z-index: 3; font-weight: 600; color: #7e8299; }
.gantt-www-days { display: flex; }
.gantt-www-d {
  flex: 0 0 auto; text-align: center; border-right: 1px solid #f3f5f8;
  color: #9ca3af; font-size: 10px; line-height: 18px;
}
.gantt-www-d.we { background: #f8fafc; }
.gantt-www-d.mo { border-left: 1px solid #e5e7eb; font-weight: 600; color: #6b7280; }
.gantt-www-row { display: flex; min-height: 28px; border-bottom: 1px solid #f3f5f8; }
.gantt-www-row.proj { background: #f5f3ff; }
.gantt-www-row.proj .gantt-www-lab { font-weight: 700; color: #5b21b6; background: #f5f3ff; }
.gantt-www-row.own .gantt-www-lab { color: #14532d; padding-left: 22px; font-size: 11px; }
.gantt-www-track { position: relative; height: 28px; flex: 1; min-width: 0; }
.gantt-www-bar {
  position: absolute; top: 6px; height: 16px; border-radius: 3px; min-width: 4px;
  background: #d0e3f3; border: 1px solid #a8c5dd; box-sizing: border-box;
}
.gantt-www-bar.proj { background: #ddd6fe; border-color: #c4b5fd; top: 7px; height: 14px; }
.gantt-www-bar.own { background: #c7e9d5; border-color: #86efac; top: 8px; height: 12px; }
.gantt-www-bar.over { background: #ffedd5; border-color: #fdba74; }
.gantt-www-bar.parent { background: #d1fae5; border-color: #6ee7b7; }
.gantt-www-today {
  position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; z-index: 1; pointer-events: none;
}

.occ-table .cell-hot { background: #fecaca; }
.occ-table .cell-mid { background: #fed7aa; }
.occ-table .cell-ok { background: #bbf7d0; }
.occ-table .cell-empty { background: #fff; color: #d1d5db; }

.header-right .btn-ghost { height: var(--ctrl-h); }
.header-right .search { min-width: 220px; }

@media (min-width: 992px) {
  .shell.is-aside-mini .aside {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: var(--aside-mini-w);
    overflow: hidden;
    transition: width 0.16s ease;
  }
  .shell.is-aside-mini .wrapper { margin-left: var(--aside-mini-w); }
  .shell.is-aside-mini .aside-brand { padding: 0; justify-content: center; }
  .shell.is-aside-mini .aside-logo,
  .shell.is-aside-mini .aside-brand .brand-mark,
  .shell.is-aside-mini .aside-brand-text,
  .shell.is-aside-mini .aside-heading,
  .shell.is-aside-mini .aside-subs,
  .shell.is-aside-mini .aside-sub,
  .shell.is-aside-mini .aside-parent-label,
  .shell.is-aside-mini .aside-chevron { display: none; }
  .shell.is-aside-mini .aside-mini-btn { margin-left: 0; }
  .shell.is-aside-mini .aside-mini-btn svg { transform: rotate(180deg); }
  .shell.is-aside-mini .aside-nav { padding: 8px 4px 24px; }
  .shell.is-aside-mini .aside-link {
    justify-content: center;
    gap: 0;
    padding: 10px 0;
    font-size: 0;
    overflow: hidden;
  }
  .shell.is-aside-mini .aside-parent { justify-content: center; }
  .shell.is-aside-mini.is-aside-hover .aside {
    width: var(--aside-w);
    overflow: auto;
    box-shadow: 12px 0 32px rgba(24, 28, 50, 0.12);
    z-index: 40;
  }
  .shell.is-aside-mini.is-aside-hover .aside .aside-brand {
    justify-content: flex-start;
    padding: 0 10px 0 12px;
  }
  .shell.is-aside-mini.is-aside-hover .aside .aside-logo { display: block; }
  .shell.is-aside-mini.is-aside-hover .aside .aside-brand .brand-mark { display: inline-flex; }
  .shell.is-aside-mini.is-aside-hover .aside .aside-brand-text,
  .shell.is-aside-mini.is-aside-hover .aside .aside-heading,
  .shell.is-aside-mini.is-aside-hover .aside .aside-parent-label,
  .shell.is-aside-mini.is-aside-hover .aside .aside-chevron { display: block; }
  .shell.is-aside-mini.is-aside-hover .aside .aside-parent-label { display: inline; }
  .shell.is-aside-mini.is-aside-hover .aside .aside-group.is-open .aside-subs { display: block; }
  .shell.is-aside-mini.is-aside-hover .aside .aside-sub { display: block; }
  .shell.is-aside-mini.is-aside-hover .aside .aside-mini-btn { margin-left: auto; }
  .shell.is-aside-mini.is-aside-hover .aside .aside-mini-btn svg { transform: none; }
  .shell.is-aside-mini.is-aside-hover .aside .aside-nav { padding: 16px 16px 24px; }
  .shell.is-aside-mini.is-aside-hover .aside .aside-link {
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 12px;
    font-size: 13px;
  }
}
@media (max-width: 991px) {
  .aside-mini-btn { display: none; }
}

#tab-gantt.gantt-page:not(.hidden) {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h));
  padding: 0;
  max-width: none;
}
.gantt_page {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.gantt_page.is-on { display: flex !important; }
/* Inset jak #calendar: .content daje 12/16 — shell bez dodatkowego paddingu */
#tab-gantt .gantt_shell,
.gantt_page .gantt_shell {
  flex: 1;
  min-height: 0;
  padding: 0;
  background: transparent;
}
.gantt_chart { flex: 1; min-height: 200px; }
.gantt_task_cell.week_end, .gantt_scale_cell.week_end { background: #e8e8e87d !important; }
.domino_projekt .gantt_task_content { font-weight: 700; }
.domino_zadanie_done .gantt_task_content { background: #4b5563; color: #f3f4f6; }
.domino_zadanie_overplan .gantt_task_content { background: #fecaca; color: #7f1d1d; }

.zp-form label { font-size: 12px; font-weight: 600; color: #5e6278; }
.zp-form select, .zp-form textarea {
  width: 100%; max-width: 280px; height: var(--ctrl-h); min-height: var(--ctrl-h); padding: 0 10px;
  border: 1px solid var(--ctrl-border); border-radius: var(--ctrl-radius); font: inherit; font-size: 13px;
  background: #fff; color: var(--text);
}
.zp-form textarea { max-width: none; min-height: 80px; }
.zp-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.zp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.zp-table th, .zp-table td { padding: 6px 8px; border-bottom: 1px solid #eef0f4; text-align: left; }
.zp-table input { width: 100%; height: var(--ctrl-h); border: 1px solid var(--ctrl-border); border-radius: var(--ctrl-radius); padding: 0 8px; font: inherit; }
.zp-muted { color: #a1a5b7; font-size: 13px; }
.zp-chk { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.zp-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.zp-inline input, .zp-inline select { max-width: 160px; }

/* Całe pole daty otwiera kalendarz (nie tylko ikona) */
input[type="date"]:not([disabled]):not([readonly]) {
  cursor: pointer;
  position: relative;
}
input[type="date"]:not([disabled]):not([readonly])::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
.zp-err { color: #f1416c; font-size: 13px; }
.zp-cmt { padding: 8px 0; border-bottom: 1px solid #eef0f4; }
.zp-x { border: 0; background: none; cursor: pointer; font-size: 16px; color: #9ca3af; }
.zp-table-wrap { overflow: auto; }
#zpCmtNew { width: 100%; min-height: 80px; margin: 12px 0; }

.fc { font-family: inherit; }
.fc .fc-toolbar-title { font-size: 13px; font-weight: 600; }
/* Organizer: przyciski FC = wielkość .cal-btn (32px) — #calBox jest korzeniem .fc */
.cal-page #calBox.fc .fc-button,
.cal-page #calBox.fc .fc-button-group > .fc-button,
#tab-calendar #calBox.fc .fc-button,
#tab-calendar #calBox.fc .fc-button-group > .fc-button {
  box-sizing: border-box !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 12px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  border-radius: 6px !important;
}
.cal-page #calBox.fc .fc-button .fc-icon,
#tab-calendar #calBox.fc .fc-button .fc-icon {
  font-size: 13px !important;
}
.fc .fc-button-primary {
  background: #fff;
  border-color: #d1d5db;
  color: #374151;
}
.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: #c5d4f7;
  border-color: #b8c9f4;
  color: #3148a8;
}
.fc .fc-day-today { background: #fff8e6; }

.um-draft { margin-bottom: 12px; }
.um-draft-card { border: 1px solid #c5d4f7; box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.08); }
.um-draft-note { margin: 0 0 12px; font-size: 12px; line-height: 1.45; }
.um-draft-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.um-tr-badge {
  font-size: 11px;
  font-weight: 600;
  color: #3148a8;
  background: #eff6ff;
  border: 1px solid #c5d4f7;
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: auto;
}
.um-tr-meta { margin: -4px 0 10px; font-size: 12px; }
.um-tr-list-draft input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--ctrl-border);
  border-radius: 6px;
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
}
.um-tr-list-draft .um-tr-lp { text-align: center; color: #5e6278; width: 36px; }
.um-linked-table tbody tr.um-linked-row { cursor: pointer; }
.um-linked-table tbody tr.um-linked-row:hover { background: #f3f6ff; }
.um-linked-table td.num { text-align: right; white-space: nowrap; }
.um-tr-list-draft select.td-mpk,
.um-draft .td-mpk,
.um-draft select.td-mpk { min-width: 180px; max-width: 100%; }
.um-row-actions { white-space: nowrap; }
.um-linked-table .js-delete-linked { font-size: 12px; }


/* ——— Pulpit (widgety, Keen-like) ——— */
.dash-page { max-width: 1400px; margin: 0 auto; }
.dash { display: flex; flex-direction: column; gap: 16px; }
.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 2px 2px;
}
.dash-date {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  color: var(--muted);
}
.dash-hello {
  margin: 4px 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.dash-quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1200px) {
  .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.dash-kpi {
  appearance: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 96px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.dash-kpi:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(76, 87, 125, 0.12);
}
.dash-kpi span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.dash-kpi b {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
}
.dash-kpi b small {
  font-size: 13px;
  font-weight: 600;
  color: #7e8299;
}
.dash-kpi em {
  font-style: normal;
  font-size: 11px;
  color: #7e8299;
}
.dash-kpi.warn b { color: #f1416c; }
.dash-kpi-hours .dash-prog {
  height: 6px;
  border-radius: 999px;
  background: #eef0f4;
  overflow: hidden;
  margin: 4px 0 2px;
}
.dash-kpi-hours .dash-prog i {
  display: block;
  height: 100%;
  background: #3699ff;
  border-radius: 999px;
}
.dash-kpi-hours .dash-prog.over i { background: #f1416c; }
.dash-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.dash-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}
.dash-grid-2 .dash-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.dash-grid-2 .dash-card-h { flex: 0 0 auto; }
.dash-grid-2 .dash-seg { flex: 0 0 auto; }
.dash-grid-2 .dash-card > :last-child {
  flex: 1 1 auto;
  min-height: 0;
}
.dash-grid-2 .dash-list {
  max-height: none;
}
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid-2 { grid-template-columns: 1fr; }
}
.dash-span-2 { grid-column: span 2; }
@media (max-width: 700px) {
  .dash-span-2 { grid-column: span 1; }
}
.dash-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 14px;
  min-height: 120px;
}
.dash-card-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.dash-card-h h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.dash-card-h .muted { margin: 2px 0 0; font-size: 12px; }
.dash-card-h .btn-ghost {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 320px;
  overflow: auto;
  font-size: 11.5px;
  color: #7e8299;
}
.dash-li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.dash-li:hover { background: #f5f8fa; }
.dash-li-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.dash-li-main strong {
  font-size: 12px;
  font-weight: 600;
  color: #5e6278;
}
.dash-li-main .muted,
.dash-li-main p {
  font-size: 10.5px;
  color: #b5b5c3;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-li-main p { margin-top: 3px; line-height: 1.4; color: #7e8299; }
.dash-li-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex: 0 0 auto;
  font-size: 10.5px;
  color: #a1a5b7;
}
.dash-li-meta .badge {
  font-size: 10px;
  padding: 2px 6px;
}
.dash-empty {
  margin: 8px 0 4px;
  font-size: 12px;
  color: #a1a5b7;
}
.dash-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.dash-seg-btn {
  appearance: none;
  border: 1px solid var(--ctrl-border);
  background: #fff;
  color: #5e6278;
  border-radius: 999px;
  height: 28px;
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.dash-seg-btn em {
  font-style: normal;
  margin-left: 4px;
  color: var(--muted);
}
.dash-seg-btn.on {
  background: #eef3ff;
  border-color: #c5d4f7;
  color: #3148a8;
}
.dash-seg-btn.on em { color: #3148a8; }
.dash-risk { display: flex; flex-direction: column; gap: 8px; }
.dash-risk-group {
  border: 1px solid #eef0f4;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.dash-risk-sum {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
}
.dash-risk-sum::-webkit-details-marker { display: none; }
.dash-risk-name { font-weight: 600; flex: 1; min-width: 0; color: #5e6278; font-size: 12px; }
.dash-risk-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #a1a5b7;
  font-size: 11px;
  font-weight: 600;
}
.dash-risk-go { flex: 0 0 auto; padding: 3px 7px; font-size: 11px; }
.dash-risk-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 2px;
}
.dash-risk-dot.day { background: #ef4444; }
.dash-risk-dot.week { background: #f59e0b; }
.dash-risk-group .dash-list { margin: 0; border-top: 1px solid #eef0f4; }
.dash-risk-group .dash-li strong { display: inline-flex; align-items: center; gap: 6px; }
.badge.dash-odch-plus { background: #fff5f8; color: #f1416c; border-color: #f7c8d5; }
.badge.dash-odch-minus { background: #e8fff3; color: #50cd89; border-color: #b7f0d0; }
.dash-table {
  font-size: 11.5px;
  color: #7e8299;
}
.dash-table td, .dash-table th {
  font-size: 11.5px;
  padding: 7px 8px;
}
.dash-table th {
  font-weight: 600;
  color: #a1a5b7;
  letter-spacing: 0.01em;
}
.dash-table td b {
  font-size: 12px;
  font-weight: 600;
  color: #5e6278;
}
.dash-table td .muted {
  font-size: 10.5px;
  color: #b5b5c3;
  margin-top: 2px;
}
.dash-table .badge {
  font-size: 10px;
  padding: 2px 6px;
}
.dash-prog {
  position: relative;
  height: 8px;
  background: #eff2f5;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
  max-width: 140px;
}
.dash-prog i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #4e73df, #7a94e8);
  border-radius: inherit;
}
.dash-prog span {
  position: absolute;
  right: 0;
  top: -16px;
  font-size: 11px;
  font-weight: 600;
  color: #5e6278;
}
.dash-metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.dash-metric b { font-size: 28px; font-weight: 700; }
.dash-metric span { font-size: 12px; color: var(--muted); }
.dash-metric.subtle b { font-size: 18px; }
.dash-spark {
  width: 100%;
  height: 56px;
  display: block;
  margin-bottom: 12px;
}
.dash-bar { fill: #e4e6ef; }
.dash-bar.on { fill: #4e73df; }
.dash-bars { display: flex; flex-direction: column; gap: 10px; }
.dash-bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.dash-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5e6278;
  font-weight: 600;
}
.dash-bar-track {
  height: 8px;
  background: #eff2f5;
  border-radius: 999px;
  overflow: hidden;
}
.dash-bar-track i {
  display: block;
  height: 100%;
  background: #4e73df;
  border-radius: inherit;
}
.dash-tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 1100px) {
  .dash-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.dash-tile {
  appearance: none;
  border: 1px solid var(--line);
  background: #f9fafc;
  border-radius: 10px;
  padding: 14px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.dash-tile:hover {
  border-color: #c5d4f7;
  background: #eef3ff;
}
.dash-tile strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.dash-tile span {
  font-size: 12px;
  color: var(--muted);
}

/* —— Wynik (ścieżka projekt/MPK) —— */
.wyn-box { margin-top: 4px; }
.wyn-card {
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 10px;
  padding: 14px 16px 8px;
}
.wyn-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.wyn-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #181c32;
}
.wyn-head p { margin: 0; font-size: 12px; }
.wyn-count { white-space: nowrap; font-size: 12px; }
.wyn-table { table-layout: auto; min-width: 960px; }
.wyn-table th:first-child,
.wyn-table td.wyn-path { min-width: 220px; width: 28%; }
.wyn-table.wyn-wide {
  table-layout: fixed;
  min-width: 900px;
  width: 100%;
}
.wyn-table.wyn-wide th:first-child,
.wyn-table.wyn-wide td.wyn-path { width: auto; min-width: 260px; }
.wyn-table.wyn-wide th.num,
.wyn-table.wyn-wide td.num {
  width: 5.6rem;
  max-width: 5.6rem;
  padding-left: 4px;
  padding-right: 6px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wyn-table.wyn-wide thead th.num {
  white-space: normal;
  line-height: 1.15;
  font-size: 11px;
  vertical-align: bottom;
  overflow: visible;
  text-overflow: clip;
}
.wyn-table tbody tr.wyn-row { cursor: default; }
.wyn-table tbody tr.wyn-leaf[data-open-project],
.wyn-table tbody tr.wyn-leaf[data-open-time],
.wyn-table tbody tr.wyn-leaf[data-open-invoice],
.wyn-table tbody tr.wyn-leaf[data-open-fk-inv] { cursor: pointer; }
.wyn-table tbody tr.wyn-doc-fs .wyn-label { color: #0f766e; }
.wyn-table tbody tr.wyn-doc-fv .wyn-label { color: #b45309; }
.wyn-table tbody tr.wyn-doc-cz .wyn-label { color: #1d4ed8; }
.wyn-table tbody tr.wyn-kind-task .wyn-label { font-weight: 600; }
.wyn-table tbody tr.wyn-group { background: #f5f8fa; }
.wyn-table tbody tr.wyn-group:hover { background: #eef3f8; }
.wyn-table tbody tr.wyn-kind-year { background: #eef2f6; }
.wyn-table tbody tr.wyn-kind-year .wyn-label { font-weight: 800; letter-spacing: 0.01em; }
.wyn-table tbody tr.wyn-kind-project .wyn-label { font-weight: 700; color: #181c32; }
.wyn-table tbody tr.wyn-kind-mpk .wyn-label { font-weight: 600; color: #3f4254; }
.wyn-table td.wyn-path { padding: 0; vertical-align: middle; }
.wyn-toggle,
.wyn-leaf-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  box-sizing: border-box;
}
.wyn-toggle {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.wyn-toggle:hover { background: rgba(0, 0, 0, 0.03); }
.wyn-leaf-pad {
  display: inline-block;
  width: 14px;
  flex: 0 0 14px;
}
.wyn-depth-0 .wyn-toggle,
.wyn-depth-0 .wyn-leaf-inner { padding-left: 12px; }
.wyn-depth-1 .wyn-toggle,
.wyn-depth-1 .wyn-leaf-inner { padding-left: 28px; }
.wyn-depth-2 .wyn-toggle,
.wyn-depth-2 .wyn-leaf-inner { padding-left: 44px; }
.wyn-depth-3 .wyn-toggle,
.wyn-depth-3 .wyn-leaf-inner { padding-left: 60px; }
.wyn-depth-4 .wyn-toggle,
.wyn-depth-4 .wyn-leaf-inner { padding-left: 76px; }
.wyn-depth-5 .wyn-toggle,
.wyn-depth-5 .wyn-leaf-inner { padding-left: 92px; }
.wyn-depth-6 .wyn-toggle,
.wyn-depth-6 .wyn-leaf-inner { padding-left: 108px; }
.wyn-depth-7 .wyn-toggle,
.wyn-depth-7 .wyn-leaf-inner { padding-left: 124px; }
.wyn-depth-8 .wyn-toggle,
.wyn-depth-8 .wyn-leaf-inner { padding-left: 140px; }
.wyn-row:not(.is-collapsed) .um-group-chevron { transform: rotate(0deg); }
.wyn-row.is-collapsed .um-group-chevron { transform: rotate(-90deg); }
.wyn-label { flex: 1 1 auto; min-width: 0; }
.wyn-table tr.wyn-total td {
  font-weight: 700;
  background: #f0f2f5;
  border-top: 1px solid #d8dce6;
  padding-top: 10px;
  padding-bottom: 10px;
}
.wyn-odch-plus { color: #0d9488; }
.wyn-odch-minus { color: #dc2626; }
.page-head-left .um-tree-btns { margin-left: 8px; }

/* Kategorie — tabela rodzajów + panel boczny */
#catGroupsTable tbody tr.cat-group-row {
  cursor: pointer;
}
#catGroupsTable tbody tr.cat-group-row:hover {
  background: #f5f8fa;
}
.cat-panel .zp-body {
  overflow: auto;
}
.cat-panel-inner {
  padding: 12px 16px 20px;
}
.cat-panel-table {
  width: 100%;
}
.cat-panel-table td.cat-panel-actions {
  white-space: nowrap;
  text-align: right;
  width: 1%;
}
.cat-panel-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #eef0f4;
}
