/* Szablon projektu — wspólny wygląd zakładek MPK / Zadania */
.tpl-proj-shell {
  --tpl-accent: #4e73df;
  --tpl-accent-hover: #3b5cc9;
  font-size: 13px;
  color: #3f4254;
  background: #fff;
  border: 1px solid #e4e6ef;
  border-radius: 10px;
  padding: 10px 12px 12px;
}

.tpl-proj-shell .embz-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tpl-proj-shell .embz-add-btn,
.tpl-proj-shell .embz-import-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid #e4e6ef;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tpl-proj-shell .embz-add-btn {
  border-color: var(--tpl-accent);
  background: var(--tpl-accent);
  color: #fff;
}

.tpl-proj-shell .embz-add-btn:hover {
  background: var(--tpl-accent-hover);
  border-color: var(--tpl-accent-hover);
}

.tpl-proj-shell .embz-import-btn {
  background: #fff;
  color: #3f4254;
}

.tpl-proj-shell .embz-import-btn:hover {
  background: #f5f8fa;
}

.tpl-proj-shell .embz-tool-btn {
  height: 34px;
  min-width: 34px;
}

.tpl-proj-shell .embz-count {
  margin-left: auto;
  color: #5e6278;
  font-size: 12px;
}

.tpl-proj-shell .embz-table-wrap {
  border: 1px solid #e4e6ef;
  border-radius: 8px;
  overflow: auto;
  max-height: min(70vh, 720px);
}

.tpl-proj-shell .tpl-proj-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.tpl-proj-shell .tpl-proj-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f5f8fa;
  color: #5e6278;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 8px 6px;
  border-bottom: 2px solid #e4e6ef;
  white-space: nowrap;
  text-align: left;
}

.tpl-proj-shell .tpl-proj-table tbody td {
  padding: 4px 6px;
  border-bottom: 1px solid #eff2f5;
  vertical-align: middle;
}

.tpl-proj-shell .tpl-proj-table tbody tr:hover td {
  background: #f9fbfd;
}

.tpl-proj-shell .tpl-proj-table tbody tr.embz-parent td {
  background: #fafbff;
  font-weight: 500;
}

.tpl-proj-shell .tpl-proj-table tbody tr.embz-parent:hover td {
  background: #f3f6fb;
}

.tpl-proj-shell .tpl-proj-table tfoot td {
  background: #f5f8fa;
  font-weight: 600;
  border-top: 2px solid #e4e6ef;
  padding: 8px 6px;
}

.tpl-proj-shell .tpl-proj-table .embz-empty {
  text-align: center;
  color: #a1a5b7;
  padding: 24px 12px;
}

.tpl-proj-shell .tpl-proj-mpk-add {
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid #e4e6ef;
  border-radius: 8px;
}

.tpl-proj-shell .tpl-proj-mpk-add label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 4px;
}

.tpl-proj-inp,
.tpl-proj-date,
.tpl-proj-sel {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #e4e6ef;
  border-radius: 6px;
  font: inherit;
  color: #3f4254;
  background: #fff;
  box-sizing: border-box;
}

.tpl-proj-inp:focus,
.tpl-proj-date:focus,
.tpl-proj-sel:focus {
  outline: none;
  border-color: #009ef7;
  box-shadow: 0 0 0 2px rgba(0, 158, 247, 0.12);
}

.tpl-proj-kod {
  flex: 0 0 72px;
  max-width: 88px;
  font-weight: 600;
}

.tpl-proj-opis {
  flex: 1 1 auto;
  min-width: 120px;
}

.tpl-proj-col-kod {
  width: 100px;
  min-width: 88px;
}

.tpl-proj-col-num {
  width: 96px;
  min-width: 80px;
}

.tpl-proj-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.tpl-proj-btn-add,
.tpl-proj-btn-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid #e4e6ef;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.tpl-proj-btn-add {
  border-color: var(--tpl-accent, #4e73df);
  color: var(--tpl-accent, #4e73df);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  padding: 0 10px;
}

.tpl-proj-btn-add:hover {
  background: rgba(78, 115, 223, 0.1);
}

.tpl-proj-btn-del {
  color: #b42318;
  border-color: #fecaca;
}

.tpl-proj-btn-del:hover {
  background: #fef2f2;
}

#tplProjStatus {
  min-height: 1.2em;
  margin: 0 0 8px;
  font-size: 12px;
  color: #5e6278;
}

#tplProjStatus.error {
  color: #b42318;
}

.tpl-proj-meta-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 16px;
  margin: 0 0 12px;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.tpl-proj-meta-card label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 4px;
}

.tpl-proj-meta-card input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e4e6ef;
  border-radius: 6px;
  font: inherit;
  box-sizing: border-box;
}

.tpl-proj-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 12px;
  border-bottom: 1px solid #e4e6ef;
  padding-bottom: 0;
}

.tpl-proj-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #5e6278;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
}

.tpl-proj-tab:hover {
  color: #3f4254;
  background: #f5f8fa;
}

.tpl-proj-tab.is-active {
  color: #4e73df;
  border-bottom-color: #4e73df;
  background: transparent;
}

.tpl-proj-tab-count {
  display: inline-block;
  min-width: 1.4em;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4e73df;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

.tpl-proj-pane[hidden] {
  display: none !important;
}

.embz-col-mpk {
  min-width: 110px;
  max-width: 160px;
}

.embz-col-mpk .tpl-proj-mpk-kod,
.embz-col-mpk .tpl-proj-sel {
  width: 100%;
  max-width: 150px;
}

#tplProjMpkTable tbody tr.embz-hidden {
  display: none;
}

#tplProjMpkTable .embz-zad-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 220px;
}

#tplProjMpkTable .embz-zad-cell .tpl-proj-kod {
  flex: 0 0 72px;
  max-width: 88px;
}

#tplProjMpkTable .embz-zad-cell .tpl-proj-opis {
  flex: 1 1 auto;
  min-width: 120px;
}

.tpl-default-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4e73df;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  line-height: 1.6;
  text-transform: none;
}

.page-head .tpl-default-badge {
  margin-left: 0;
  align-self: center;
}

.tpl-proj-meta-card label .tpl-default-badge {
  margin-left: 6px;
  text-transform: none;
  letter-spacing: 0.02em;
}

.tpl-row-default td {
  background: #f8faff;
}
