/* Профили объектов: тип объекта, обязательные СИЗ по зонам, оборудование. Редактор объекта и карточка камеры. */

/* у элементов редактора свой display — атрибут hidden должен побеждать */
.editor-page [hidden] { display: none !important; }

/* ---------------------------------------------------------------- список объектов */
.pf-card-line { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.pf-unset { color: var(--p2); }

/* ---------------------------------------------------------------- редактор: вкладка «Профиль и СИЗ» */
.pf-pane { flex: 1; min-height: 0; overflow: auto; background: var(--ground); }
.pf-wrap { max-width: 1180px; margin: 0 auto; padding: 8px 20px 32px; }
.pf-wrap > .notice { margin-top: 12px; }
.pf-wrap .section > header h2 { font-size: 15px; }
.pf-block { display: grid; gap: 10px; min-width: 0; }

.pf-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.pf-type {
  display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pf-type:hover { border-color: var(--line-2); }
.pf-type:has(input:checked) { border-color: var(--select); background: var(--select-bg); }
.pf-type input { accent-color: var(--select); width: 15px; height: 15px; margin: 2px 0 0; }
.pf-type > span { display: grid; gap: 2px; min-width: 0; }
.pf-type b { font-weight: 600; }

.pf-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 9px 16px; }
.pf-checks .checkbox { color: var(--text-2); align-items: flex-start; }
.pf-checks .checkbox input { margin: 2px 0 0; flex: none; }
.pf-checks .checkbox:has(input:checked) { color: var(--text); }
.pf-source { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }

/* матрица: камеры × СИЗ */
.pf-matrix-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.pf-matrix { min-width: 760px; }
.pf-matrix th, .pf-matrix td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.pf-matrix tbody tr:last-child > * { border-bottom: 0; }
.pf-matrix thead th { font-size: 12px; font-weight: 500; color: var(--text-3); text-align: left; background: var(--panel-2); }
.pf-matrix .pf-col { text-align: center; width: 74px; line-height: 1.2; }
.pf-cam { text-align: left; font-weight: 400; min-width: 240px; display: grid; gap: 5px; }
.pf-cam-name { color: var(--text); text-decoration: none; font-size: 13px; }
.pf-cam-name:hover { color: #fff; text-decoration: underline; }
.pf-cam-name b { font-weight: 600; margin-right: 4px; }
.pf-zone { height: 28px; font-size: 13px; }
.pf-cell { text-align: center; }
.pf-matrix tbody tr:hover { background: transparent; }

.pf-m {
  display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid transparent;
  border-radius: var(--radius); background: transparent; cursor: pointer; vertical-align: middle;
}
button.pf-m:hover { background: var(--panel-2); border-color: var(--line-2); }
.pf-m i { display: block; width: 12px; height: 2px; border-radius: 1px; background: var(--line-2); }
.pf-m.on i { width: 11px; height: 11px; border-radius: 50%; background: var(--text-2); }
.pf-m.zone { border: 1px dashed var(--text-2); }
.pf-m.zone i { background: var(--text); }
.pf-m.zone:not(.on) i { background: var(--text-2); }
.pf-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.pf-legend > span { display: inline-flex; align-items: center; gap: 4px; }
.pf-legend .pf-m { width: 22px; height: 22px; cursor: default; }
.pf-legend .cell-sub { margin-left: auto; }

.pf-norms { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); font-size: 13px; max-width: 80ch; }

/* ---------------------------------------------------------------- карточка камеры */
.pf-head-line { font-size: 13px; margin-top: 4px; color: var(--text-2); }
.pf-head-line a { color: var(--text-2); text-decoration: none; }
.pf-head-line a:hover { color: var(--text); text-decoration: underline; }
.pf-head-line b { color: var(--text); font-weight: 600; }

.pf-ppe {
  display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: flex-start; justify-content: space-between;
  padding: 0 0 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
.pf-ppe-main { display: grid; gap: 4px; min-width: 0; flex: 1 1 420px; }
.pf-ppe-main h2 { font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.pf-ppe-main p { margin: 0; max-width: 90ch; }
.pf-ppe-line b { font-size: 16px; font-weight: 600; }
.pf-ppe-edit {
  flex: 1 1 100%; display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--panel-2);
}
.pf-ppe-zone { max-width: 520px; }
.pf-ppe-rows { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pf-ppe-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; padding: 7px 10px; background: var(--panel); }
.pf-ppe-row .seg { background: var(--inset); }
.pf-ppe-row .seg button { height: 28px; font-size: 13px; }
.pf-ppe-foot { justify-content: flex-end; }
.pf-rule-off { color: var(--text-3); font-style: normal; }

@media (max-width: 760px) {
  .pf-wrap { padding: 4px 16px 96px; }   /* нижняя панель навигации не закрывает последний раздел */
  .pf-wrap .section { grid-template-columns: 1fr; gap: 10px; }
  .pf-types, .pf-checks { grid-template-columns: 1fr; }
  .pf-cam { min-width: 190px; position: sticky; left: 0; z-index: 1; background: var(--panel); }
  .pf-matrix thead th:first-child { position: sticky; left: 0; z-index: 1; }
  .pf-legend .cell-sub { margin-left: 0; flex-basis: 100%; }
  .pf-ppe-row { padding: 8px; }
  .pf-ppe-row .seg { width: 100%; }
  .pf-ppe-row .seg button { flex: 1; padding: 0 6px; }
}

/* вкладки «План / Профиль и СИЗ» — как сегменты */
.editor-bar .seg [aria-selected="true"] { background: var(--select-bg); color: var(--text); box-shadow: inset 0 -2px 0 var(--select); }
.pf-origin { margin: 2px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 13px; color: var(--text-2); }
.pf-ppe-row > span { display: grid; gap: 1px; }
.pf-ppe-row .seg button { min-width: 118px; }
