/* Podgląd projektu i pracownika — karta tożsamości + zakładki bez tła
   Content padding=0 (full height); inset 12/16 na shellu = jak .content / #calendar */

.content:has(#tab-project.profil-page:not(.hidden)),
.content:has(#tab-employee.profil-page:not(.hidden)),
.content:has(#tab-contract.profil-page:not(.hidden)),
.content:has(#tab-invoice.profil-page:not(.hidden)),
.content:has(#tab-fk-faktura.profil-page:not(.hidden)),
.content:has(#tab-fk-koszt.profil-page:not(.hidden)) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
#tab-project.profil-page:not(.hidden),
#tab-employee.profil-page:not(.hidden),
#tab-contract.profil-page:not(.hidden),
#tab-invoice.profil-page:not(.hidden),
#tab-fk-faktura.profil-page:not(.hidden),
#tab-fk-koszt.profil-page:not(.hidden) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  padding: 0;
  max-width: none;
}

#projektProfil,
#pracownikProfil,
#umowaProfil,
#fakturaProfil,
#fkFakturaProfil,
#fkKosztProfil {
  --prp-accent: #3148a8;
  font-size: 10pt;
  color: #3f4254;
  background: transparent;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px 8px;
}
#projektProfil *,
#pracownikProfil *,
#umowaProfil *,
#fakturaProfil *,
#fkFakturaProfil *,
#fkKosztProfil * { box-sizing: border-box; }

.prp-page-title,
.pp-page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.2;
}
.prp-top,
.pp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  flex: 0 0 auto;
}
.prp-top-actions,
.pp-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.prp-id,
.pp-id {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 8px;
  margin: 0 0 12px;
  flex: 0 0 auto;
}
.prp-id-av,
.pp-id-av {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 56px;
  text-align: center;
  flex: 0 0 auto;
  overflow: hidden;
}
img.pp-id-av { object-fit: cover; display: block; background: #eef0f4; }
.prp-id-main,
.pp-id-main { min-width: 0; flex: 1; }
.prp-id-name,
.pp-id-name {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 4px;
}
.prp-id-name strong,
.pp-id-name strong {
  font-size: 20px;
  font-weight: 600;
  color: #181c32;
}
.pp-id-mail { color: #a1a5b7; font-size: 13px; margin: 0 0 12px; }
.prp-id-grid,
.pp-id-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
  margin-top: 8px;
}
.prp-id-grid span,
.pp-id-grid span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #7e8299;
  text-transform: uppercase;
  letter-spacing: .02em;
  margin-bottom: 2px;
}
.prp-id-grid b,
.pp-id-grid b { font-weight: 500; color: #3f4254; font-size: 13px; }
.prp-id-actions,
.pp-id-actions { flex: 0 0 auto; }

.prp-status-pill,
.pp-status-pill {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: #eef0f4;
  color: #3f4254;
}
.prp-pill-prep, .pp-pill-prep { background: #e5e7eb; color: #374151; }
.prp-pill-run, .pp-pill-run { background: #dbeafe; color: #1e40af; }
.prp-pill-done, .pp-pill-done { background: #d1fae5; color: #047857; }
.prp-pill-hold, .pp-pill-hold { background: #fef3c7; color: #92400e; }
.prp-pill-rej, .pp-pill-rej { background: #fee2e2; color: #b91c1c; }

#projektProfil .prp-tabs,
#pracownikProfil .pp-tabs,
#pracownikProfil .prp-tabs,
#umowaProfil .prp-tabs,
#fakturaProfil .prp-tabs,
#fkFakturaProfil .prp-tabs,
#fkKosztProfil .prp-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid #eef0f4;
  margin: 0 0 10px;
  flex: 0 0 auto;
  overflow-x: auto;
  background: transparent;
}
#projektProfil .prp-tab,
#pracownikProfil .pp-tab,
#pracownikProfil .prp-tab,
#umowaProfil .prp-tab,
#fakturaProfil .prp-tab,
#fkFakturaProfil .prp-tab,
#fkKosztProfil .prp-tab {
  appearance: none;
  border: 0;
  background: transparent;
  height: 38px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #5e6278;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
#projektProfil .prp-tab:hover,
#pracownikProfil .prp-tab:hover,
#umowaProfil .prp-tab:hover,
#fakturaProfil .prp-tab:hover,
#fkFakturaProfil .prp-tab:hover,
#fkKosztProfil .prp-tab:hover { color: #3f4254; background: transparent; }
#projektProfil .prp-tab.is-active,
#projektProfil .prp-tab.on,
#pracownikProfil .prp-tab.is-active,
#pracownikProfil .prp-tab.on,
#umowaProfil .prp-tab.is-active,
#umowaProfil .prp-tab.on,
#fakturaProfil .prp-tab.is-active,
#fakturaProfil .prp-tab.on,
#fkFakturaProfil .prp-tab.is-active,
#fkFakturaProfil .prp-tab.on,
#fkKosztProfil .prp-tab.is-active,
#fkKosztProfil .prp-tab.on {
  color: var(--prp-accent);
  border-bottom-color: #c5d4f7;
  font-weight: 600;
  background: transparent;
}

.prp-scroll,
.pp-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;
}

/* Faktura kosztowa: formularz + podgląd po prawej */
#fkFakturaProfil .fk-inv-work {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 42%);
  gap: 14px;
  align-items: stretch;
}
#fkFakturaProfil .fk-inv-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#fkFakturaProfil .fk-inv-main .prp-tabs {
  flex: 0 0 auto;
}
#fkFakturaProfil .fk-inv-main .prp-scroll {
  flex: 1 1 auto;
}
/* Combo projektu/MPK musi wychodzić poza scroll — inaczej wybór „nie działa” */
#fkFakturaProfil .fk-inv-main:has(.um-combo.is-open),
#fkFakturaProfil .fk-inv-main .prp-scroll:has(.um-combo.is-open),
#fkFakturaProfil #fkInvBody:has(.um-combo.is-open) {
  overflow: visible;
}
#fkFakturaProfil .fk-inv-preview-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #e4e6ef;
  border-radius: 10px;
  background: #f6f7fb;
  overflow: hidden;
}
#fkFakturaProfil .fk-inv-preview-head {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e4e6ef;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #181c32;
}
#fkFakturaProfil .fk-inv-preview-src {
  font-weight: 500;
  font-size: 11px;
  color: #7e8299;
}
#fkFakturaProfil .fk-inv-preview-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}
#fkFakturaProfil .fk-inv-preview-pdf {
  display: block;
  width: 100%;
  min-height: 520px;
  height: calc(100vh - 220px);
  max-height: 900px;
  border: 0;
  border-radius: 4px;
  background: #fff;
}
#fkFakturaProfil .fk-doc {
  background: #fff;
  border: 1px solid #e4e6ef;
  border-radius: 6px;
  padding: 18px 16px 20px;
  box-shadow: 0 1px 2px rgba(24, 28, 50, 0.04);
  color: #181c32;
  font-size: 12px;
  line-height: 1.45;
}
#fkFakturaProfil .fk-doc-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef0f4;
}
#fkFakturaProfil .fk-doc-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
}
#fkFakturaProfil .fk-doc-meta {
  color: #5e6278;
  font-size: 11px;
}
#fkFakturaProfil .fk-doc-ksef {
  text-align: right;
  font-size: 11px;
  color: #3f4254;
  max-width: 48%;
  word-break: break-all;
}
#fkFakturaProfil .fk-doc-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
#fkFakturaProfil .fk-doc-party h4 {
  margin: 0 0 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a1a5b7;
  font-weight: 600;
}
#fkFakturaProfil .fk-doc-party b {
  display: block;
  margin-bottom: 2px;
}
#fkFakturaProfil .fk-doc-party span {
  display: block;
  color: #5e6278;
  font-size: 11px;
}
#fkFakturaProfil .fk-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px;
  font-size: 11px;
}
#fkFakturaProfil .fk-doc th,
#fkFakturaProfil .fk-doc td {
  border-bottom: 1px solid #eef0f4;
  padding: 6px 4px;
  text-align: left;
  vertical-align: top;
}
#fkFakturaProfil .fk-doc th {
  color: #7e8299;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
}
#fkFakturaProfil .fk-doc td.num,
#fkFakturaProfil .fk-doc th.num {
  text-align: right;
  white-space: nowrap;
}
#fkFakturaProfil .fk-doc-totals {
  margin-left: auto;
  width: min(220px, 100%);
}
#fkFakturaProfil .fk-doc-totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
}
#fkFakturaProfil .fk-doc-totals .fk-doc-gross {
  font-weight: 700;
  border-top: 1px solid #e4e6ef;
  margin-top: 4px;
  padding-top: 6px;
}
#fkFakturaProfil .fk-doc-empty {
  color: #7e8299;
  font-size: 12px;
  padding: 24px 8px;
  text-align: center;
}
@media (max-width: 1100px) {
  #fkFakturaProfil .fk-inv-work {
    grid-template-columns: 1fr;
  }
  #fkFakturaProfil .fk-inv-preview-pane {
    max-height: 420px;
  }
}

/* Gantt w profilu projektu — pełna wysokość jak w WWW */
#projektProfil.prp-gantt-on .prp-scroll {
  overflow: hidden;
  padding-bottom: 0;
}
#projektProfil.prp-gantt-on #prpGanttHost,
#projektProfil.prp-gantt-on #prpGanttPrognozaHost,
#projektProfil.prp-gantt-on #gantt_page_projekt,
#projektProfil.prp-gantt-on #gantt_shell_projekt,
#projektProfil.prp-gantt-on #gantt_page_projekt_prognoza,
#projektProfil.prp-gantt-on #gantt_shell_projekt_prognoza {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
#projektProfil.prp-gantt-on #gantt_shell_projekt,
#projektProfil.prp-gantt-on #gantt_shell_projekt_prognoza {
  padding: 0;
}
#projektProfil.prp-gantt-on #gantt_here_projekt,
#projektProfil.prp-gantt-on #gantt_here_projekt_prognoza {
  flex: 1 1 auto;
  min-height: 280px;
}
#projektProfil.prp-gantt-on .flt-row:has(#ganttFltProjects) {
  display: none !important;
}

.prp-panel { display: none; }
.prp-panel.is-active { display: block; }
#projektProfil .prp-scroll {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#projektProfil [data-prp-panel="czas"].is-active,
#projektProfil [data-prp-panel="harmonogram"].is-active,
#projektProfil [data-prp-panel="gantt"].is-active,
#projektProfil [data-prp-panel="gantt-prognoza"].is-active {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
}
#projektProfil [data-prp-panel="czas"] .cp-projekt,
#projektProfil #embZadania {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
#projektProfil.prp-embz-filters-open #embZadania {
  overflow: visible;
}
#projektProfil.prp-embz-filters-open.prp-harm-on .prp-scroll {
  overflow: visible;
}
#projektProfil [data-prp-panel="czas"] .cp-projekt .cp-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}
#projektProfil.prp-czas-on .prp-scroll,
#projektProfil.prp-harm-on .prp-scroll {
  overflow: hidden;
  padding-bottom: 0;
}
#projektProfil #prpGanttHost {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.prp-section-head,
.pp-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.prp-section-head h2,
.pp-section-head h2 {
  margin: 0 auto 0 0;
  font-size: 15px;
  font-weight: 600;
  color: #181c32;
}
.prp-section-head.prp-section-tools-only,
.pp-section-head.pp-section-tools-only {
  justify-content: flex-end;
  margin-bottom: 12px;
}
.prp-section-head.prp-section-tools-only .prp-tab-tools,
.pp-section-head.pp-section-tools-only .pp-tab-tools {
  margin-left: 0;
}
.prp-section-head.prp-section-tools-left,
.pp-section-head.pp-section-tools-left {
  justify-content: flex-start;
}
.prp-section-head.prp-section-tools-left .prp-tab-tools,
.pp-section-head.pp-section-tools-left .pp-tab-tools {
  margin-left: 0;
  margin-right: auto;
}
.pp-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.prp-tab-tools,
.pp-tab-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.prp-search {
  height: 32px;
  width: 180px;
  padding: 0 10px;
  border: 1px solid #e4e6ef;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  color: #3f4254;
}

.prp-table-wrap,
.pp-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 8px;
}
.prp-table-wrap .table,
.pp-table-wrap .table,
.prp-table,
.pp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 13px;
  color: #3f4254;
}
.prp-table-wrap th,
.pp-table-wrap th,
.prp-table thead th,
.pp-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: #7e8299;
  padding: 12px 14px;
  border-bottom: 1px solid #eef0f4;
  background: #fafbfc;
  white-space: nowrap;
}
.prp-table-wrap td,
.pp-table-wrap td,
.prp-table tbody td,
.pp-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef0f4;
  vertical-align: top;
}
.prp-table-wrap tbody tr:hover td,
.pp-table-wrap tbody tr:hover td { background: #f8fafc; }

.prp-info-table { min-width: 0; }
.prp-info-table th,
.prp-info-table td { padding: 12px 20px; }
.prp-info-table th {
  width: 32%;
  font-weight: 500;
  color: #3f4254;
  background: #fff;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}
.prp-info-table td {
  font-weight: 600;
  color: #181c32;
}
.prp-info-table tbody tr:hover td { background: #fff; }

.prp-btn,
.pp-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;
}
.prp-btn:hover,
.pp-btn:hover { background: #f9f9f9; border-color: #b5b5c3; }
.prp-btn-primary,
.pp-btn-primary {
  background: #4e73df;
  border-color: #4e73df;
  color: #fff;
  font-weight: 500;
}
.prp-btn-primary:hover,
.pp-btn-primary:hover {
  background: #3b5cc9;
  border-color: #3b5cc9;
  color: #fff;
}

.prp-overview {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 2px 0 16px;
}
.prp-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.prp-kpi {
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 10px;
  padding: 14px 16px;
  min-width: 0;
}
.prp-kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #7e8299;
  margin-bottom: 6px;
}
.prp-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #181c32;
  line-height: 1.2;
}
.prp-kpi-hint { margin-top: 4px; font-size: 12px; color: #a1a5b7; }
.prp-dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
}
#projektProfil .prp-card,
#pracownikProfil .pp-card,
#umowaProfil .prp-card,
#fakturaProfil .prp-card,
#fkFakturaProfil .prp-card,
#fkKosztProfil .prp-card {
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 10px;
  padding: 16px;
  overflow: visible;
  box-shadow: none;
}
#projektProfil .prp-card-head,
#pracownikProfil .pp-card-head,
#umowaProfil .prp-card-head,
#fakturaProfil .prp-card-head,
#fkFakturaProfil .prp-card-head,
#fkKosztProfil .prp-card-head {
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
}
#projektProfil .prp-card-head h3,
#pracownikProfil .pp-card-head h3,
#umowaProfil .prp-card-head h3,
#fakturaProfil .prp-card-head h3,
#fkFakturaProfil .prp-card-head h3,
#fkKosztProfil .prp-card-head h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: #181c32;
}
#umowaProfil .um-stack,
#fkFakturaProfil .um-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#umowaProfil .um-card-head,
#fkFakturaProfil .um-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
#umowaProfil .um-card-head h3,
#fkFakturaProfil .um-card-head h3 { margin: 0; }
#umowaProfil .prp-kpis { margin-bottom: 12px; }
#umowaProfil .umowa-form label,
#fakturaProfil .umowa-form label,
#fkFakturaProfil .umowa-form label,
#fkKosztProfil .umowa-form label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #181c32;
  margin-bottom: 4px;
}
#umowaProfil .umowa-form .chk,
#fakturaProfil .umowa-form .chk,
#fkFakturaProfil .umowa-form .chk,
#fkKosztProfil .umowa-form .chk {
  font-weight: 500;
  color: #3f4254;
}
#fakturaProfil .prp-card-body,
#fkFakturaProfil .prp-card-body { padding-top: 0; }
#fakturaProfil .um-cols,
#fkFakturaProfil .um-cols,
#fkKosztProfil .um-cols {
  gap: 24px 40px;
  padding: 20px 22px 28px;
}
#fakturaProfil .um-cols .um-col,
#fkFakturaProfil .um-cols .um-col,
#fkKosztProfil .um-cols .um-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#fakturaProfil .um-field > label,
#fkFakturaProfil .um-field > label,
#fkKosztProfil .um-field > label { margin-bottom: 6px; }
#fakturaProfil .um-field input,
#fakturaProfil .um-field select,
#fkFakturaProfil .um-field input,
#fkFakturaProfil .um-field select,
#fkKosztProfil .um-field input,
#fkKosztProfil .um-field select { margin-top: 0; }
#fakturaProfil .um-field.kh-flags,
#fkFakturaProfil .um-field.kh-flags { gap: 10px; }
#fakturaProfil .kh-preview,
#fkFakturaProfil .kh-preview { margin-top: 8px; }
#fakturaProfil .inv-vat-wrap { margin-top: 18px; }
#fakturaProfil .inv-vat-wrap.hidden { display: none; }
#fakturaProfil .inv-vat-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #181c32;
}
#fakturaProfil .inv-pos-total td {
  font-weight: 700;
  background: #f9fafb;
  border-top: 2px solid #e4e6ef;
}
#fakturaProfil .inv-zal-pick { flex-wrap: wrap; }
#fakturaProfil .z-num-lab { font-size: 11px; margin-top: 4px; }
.prp-summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.prp-sum {
  background: #f9fafb;
  border-radius: 8px;
  padding: 10px 12px;
}
.prp-sum span { display: block; font-size: 12px; color: #7e8299; margin-bottom: 4px; }
.prp-sum b { font-size: 20px; color: #181c32; }
.prp-sum-active { background: #eef6ff; }
.prp-sum-active b { color: #1e40af; }
.prp-sum-done { background: #ecfdf5; }
.prp-sum-done b { color: #047857; }
.prp-sum-over { background: #fff7ed; }
.prp-sum-over b { color: #c2410c; }
.prp-sum-yet { background: #f5f3ff; }
.prp-sum-yet b { color: #6d28d9; }
.prp-progress {
  margin-top: 12px;
  height: 8px;
  background: #eef0f4;
  border-radius: 99px;
  overflow: hidden;
}
.prp-progress-bar { height: 100%; background: #c5d4f7; border-radius: 99px; }
.prp-team { display: flex; flex-wrap: wrap; gap: 6px; }
.prp-team-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 36px;
  text-align: center;
}
.prp-team-names { margin-top: 10px; font-size: 13px; color: #5e6278; line-height: 1.45; }
.prp-bars { display: flex; flex-direction: column; gap: 8px; }
.prp-bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 72px;
  gap: 10px;
  align-items: center;
}
.prp-bar-lab {
  font-size: 12px;
  color: #3f4254;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prp-bar-track { height: 8px; background: #eef0f4; border-radius: 99px; overflow: hidden; }
.prp-bar-fill { height: 100%; background: #50cd89; border-radius: 99px; }
.prp-bar-val { font-size: 12px; color: #7e8299; text-align: right; }
.prp-placeholder,
.pp-placeholder {
  color: #a1a5b7;
  font-size: 13px;
  padding: 24px 8px;
  text-align: center;
}
.prp-list-wrap .item {
  border: 0;
  border-bottom: 1px solid #eef0f4;
  border-radius: 0;
  box-shadow: none;
  padding: 12px 14px;
}

@media (max-width: 900px) {
  .prp-kpis,
  .prp-dash-grid,
  .prp-summary-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .prp-kpis,
  .prp-dash-grid,
  .prp-summary-row { grid-template-columns: 1fr; }
}

/* Profil pracownika — narzędzia, filtry, miesiąc, modal (jak WWW) */
#pracownikProfil { --pp-accent: #3148a8; }
#pracownikProfil .pp-tab.is-active {
  color: var(--pp-accent);
  border-bottom-color: var(--pp-accent);
  font-weight: 600;
}
.pp-status {
  color: #a1a5b7;
  min-height: 0;
  margin: 0;
  flex: 0 0 auto;
  font-size: 13px;
}
.pp-status:not(:empty) { min-height: 18px; margin: 0 0 6px; }
.pp-status.is-error { color: #f1416c; }
.pp-panel { display: none; }
.pp-panel.is-active { display: block; }
.pp-search {
  flex: 0 0 200px;
  width: 200px;
  min-width: 140px;
  max-width: 240px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #e4e6ef;
  border-radius: 6px;
  font-size: 13px;
  color: #3f4254;
  background: #fff;
}
.pp-search:focus {
  outline: none;
  border-color: var(--pp-accent);
  box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.18);
}
.pp-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin: 0;
  height: 32px;
  box-sizing: border-box;
  padding: 0 10px 0 6px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e4e6ef;
}
.pp-switch-input { position: absolute; opacity: 0; width: 0; height: 0; }
.pp-switch-track {
  width: 32px;
  height: 18px;
  border-radius: 99px;
  background: #e4e6ef;
  position: relative;
  flex: 0 0 auto;
}
.pp-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.pp-switch-input:checked + .pp-switch-track { background: #93c5fd; }
.pp-switch-input:checked + .pp-switch-track::after { left: 16px; }
.pp-switch-label { font-size: 13px; color: #3f4254; font-weight: 500; }
.pp-switch-input:checked ~ .pp-switch-label { color: #1e3a8a; }
.pp-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #5e6278;
  white-space: nowrap;
}
.pp-select {
  height: 32px;
  border: 1px solid #e4e6ef;
  border-radius: 6px;
  padding: 0 8px;
  font: inherit;
  font-size: 13px;
  color: #3f4254;
  background: #fff;
}
.pp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 0;
  font-size: 13px;
  color: #374151;
  font-weight: 500;
}
.pp-filters-wrap { position: relative; z-index: 60; }
.pp-btn.has-filters,
.flt-btn.has-filters {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
}
.pp-filter-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  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;
}
.pp-filters-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 640px;
  max-width: min(640px, 96vw);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  padding: 16px 18px;
  box-sizing: border-box;
  z-index: 120;
}
.pp-filters-narrow { width: 320px; max-width: min(320px, 96vw); }
.pp-filters-narrow .pp-switch { width: 100%; margin-top: 4px; }
.pp-filters-popover[hidden] { display: none !important; }
.pp-filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 15px;
  color: #111827;
}
.pp-link-btn {
  border: 0;
  background: transparent;
  color: #4e73df;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 0;
}
.pp-link-btn:hover { text-decoration: underline; }
.pp-group-row td {
  background: #f6f7fb;
  font-weight: 700;
  color: #181c32;
  cursor: pointer;
  user-select: none;
}
.pp-group-row:hover td { background: #eef1f6; }
.pp-group-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 8px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #7e8299;
  vertical-align: middle;
}
.pp-group-row.is-collapsed .pp-group-chevron { transform: rotate(-90deg); }
.pp-table tbody td.pp-empty {
  text-align: center;
  color: #a1a5b7;
  cursor: default;
  padding: 48px 16px;
}
#ppHoursTable, #ppTasksTable, #ppPayTable, #ppOblTable { min-width: 860px; }
.pp-info-table { min-width: 640px; }
.pp-info-table th {
  width: 280px;
  max-width: 46%;
  font-weight: 500;
  color: #3f4254;
  background: #fff;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}
.pp-info-table td {
  font-weight: 600;
  color: #181c32;
}
[data-pp-panel="uprawnienia"] .pp-table-wrap { margin: 0; }
[data-pp-panel="uprawnienia"] .pp-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: #7e8299;
  line-height: 1.45;
}
.pp-doc-view-box {
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 4px;
}
.pp-doc-view-box .pp-field { display: block; margin: 0; }
.pp-doc-view-box .pp-field > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #5e6278;
  margin-bottom: 6px;
}
.pp-doc-view-box .mpick { width: 100%; }
#ppDocViewStatus { margin: 8px 0 0; min-height: 1.2em; }
.pp-scroll .pp-section-head:not(:first-child) { margin-top: 16px; }
.pp-month-nav { display: inline-flex; align-items: center; gap: 6px; }
.pp-month-label {
  min-width: 140px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #181c32;
}
.pp-btn-icon { width: 32px; padding: 0; font-size: 18px; line-height: 1; }
.pp-month-cal {
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 12px;
}
.pp-month-week, .pp-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.pp-month-week {
  margin-bottom: 6px;
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
}
.pp-month-week span:nth-child(6),
.pp-month-week span:nth-child(7) { color: #2c3f8f; font-weight: 600; }
.pp-month-empty { min-height: 44px; }
.pp-month-day {
  min-height: 52px;
  border-radius: 8px;
  padding: 6px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pp-month-num { font-size: 12px; color: #5e6278; font-weight: 600; }
.pp-month-mark { font-size: 11px; font-weight: 700; color: #1e3a8a; }
.pp-month-day.is-today { box-shadow: inset 0 0 0 1px var(--pp-accent); }
.pp-month-day.has-items { background: #eff6ff; }
.pp-month-cal-hours .pp-month-day.is-low { background: #dbeafe; }
.pp-month-cal-hours .pp-month-day.is-mid { background: #93c5fd; }
.pp-month-cal-hours .pp-month-day.is-mid .pp-month-mark { color: #1e3a8a; }
.pp-month-cal-hours .pp-month-day.is-full { background: #3b82f6; }
.pp-month-cal-hours .pp-month-day.is-full .pp-month-num,
.pp-month-cal-hours .pp-month-day.is-full .pp-month-mark { color: #fff; }
#ppPayTable tbody tr, #ppBonusTable tbody tr { cursor: pointer; }
#ppTasksTbody tr[data-open-task],
#ppOrgTbody tr[data-open-task],
#ppOblTbody tr[data-open-task] { cursor: pointer; }
.pp-perm-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.pp-perm-switch {
  width: 100%;
  height: auto;
  min-height: 36px;
  padding: 8px 10px;
  justify-content: flex-start;
}
.pp-modal-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  z-index: 120;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px 24px;
  overflow: auto;
}
.pp-modal {
  width: 640px;
  max-width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  padding: 20px 22px 18px;
  position: relative;
}
.pp-modal h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  color: #1e3a5f;
}
.pp-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 22px;
  color: #6b7280;
  cursor: pointer;
  border-radius: 8px;
}
.pp-modal-close:hover { background: #f3f4f6; }
.pp-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.pp-row[hidden],
.pp-row.is-off,
.pp-bonus-period-row.is-off {
  display: none !important;
}
.pp-row > span:first-child {
  color: #1e3a5f;
  font-weight: 600;
  font-size: 13px;
}
.pp-row input, .pp-row select {
  display: block;
  width: 100%;
  min-height: 34px;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  color: #1f2937;
  background: #fff;
}
.pp-modal .pp-hint { margin: -4px 0 12px 182px; font-size: 12px; color: #7e8299; }
.pp-modal-status { min-height: 18px; margin: 4px 0 10px; font-size: 13px; color: #5e6278; }
.pp-modal-status.is-err { color: #f1416c; }
.pp-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.pp-modal-bonus { width: 720px; }
.pp-bonus-emp {
  margin: 0 0 14px;
  font-size: 13px;
  color: #5e6278;
}
.pp-row-top { align-items: start; }
.pp-photo-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.pp-photo-preview-wrap {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  border: 1px dashed #cdd2de;
  background: #f9fafb;
  overflow: hidden;
}
.pp-photo-preview {
  width: 96px;
  height: 96px;
  object-fit: cover;
  display: block;
}
.pp-photo-preview.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #a1a5b7;
}
.pp-photo-hint { margin: 0 !important; }
.pp-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-photo-box input[type="url"] { width: 100%; }
.pp-row-top textarea {
  display: block;
  width: 100%;
  min-height: 56px;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
}
.pp-bonus-ms {
  margin: 8px 0 12px;
  padding-top: 8px;
  border-top: 1px solid #eef0f4;
}
.pp-bonus-ms-head {
  font-size: 12px;
  font-weight: 700;
  color: #475467;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.pp-bonus-ms-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}
.pp-bonus-ms-cell {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 8px;
  text-align: center;
}
.pp-bonus-ms-cell span {
  display: block;
  font-size: 10px;
  color: #98a2b3;
  margin-bottom: 2px;
}
.pp-bonus-ms-cell strong {
  font-size: 12px;
  color: #344054;
  font-weight: 600;
}
@media (max-width: 720px) {
  .pp-bonus-ms-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
