/* Стили экрана pages.js (docs/PANEL-V2.md): только классы с префиксом экрана. */

/* ——— инциденты: крупные карточки ——— */
.pg-inc {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 14px; align-items: start;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px 18px 16px 16px;
}
.pg-inc + .pg-inc { margin-top: 12px; }
.pg-inc.pg-red { border-left: 3px solid var(--red); }
.pg-inc.pg-amber { border-left: 3px solid var(--amber); }
.pg-inc-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.pg-inc h3 { margin: 6px 0 0; font-size: 17px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.pg-inc .where { font-size: 13px; color: var(--soft); margin-top: 6px; overflow-wrap: anywhere; }
.pg-inc .what { font-size: 13px; color: var(--muted); margin: 6px 0 0; line-height: 1.45; overflow-wrap: anywhere; }
.pg-inc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; padding-top: 4px; }
.pg-calm { display: flex; gap: 14px; align-items: center; }
.pg-calm b { display: block; font-size: 16px; font-weight: 600; }
.pg-calm span:not(.pg-inc-ic) { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
/* закрытые за 7 суток (журнал тревог сторожа) */
.pg-hist { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; }
.pg-hist + .pg-hist { border-top: 1px solid var(--border); }
.pg-hist-ic { padding-top: 2px; }
.pg-hist-main b { display: block; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.pg-hist-main .where { display: inline-block; font-size: 13px; color: var(--soft); margin-top: 4px; overflow-wrap: anywhere; }
.pg-hist-main .what { font-size: 13px; color: var(--muted); margin: 4px 0 0; line-height: 1.45; overflow-wrap: anywhere; }
.pg-hist-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 13px; color: var(--soft); white-space: nowrap; }
.pg-mute { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; overflow-wrap: anywhere; }
/* принятие и заглушка серверной тревоги: принятая — с галочкой, заглушённая — приглушённым тоном */
.pg-inc.pg-acked { border-left-color: var(--good); }
.pg-inc.pg-snoozed { border-left-color: var(--gray); background: var(--inset); }
.pg-inc.pg-snoozed h3, .pg-inc.pg-snoozed .where { color: var(--muted); }
.pg-inc.pg-snoozed .pg-inc-ic { opacity: .55; }
.pg-ack, .pg-snz { display: flex; gap: 7px; align-items: flex-start; font-size: 13px; margin: 8px 0 0; line-height: 1.4; overflow-wrap: anywhere; }
.pg-ack { color: var(--good); } .pg-snz { color: var(--soft); }
.pg-ack .i, .pg-snz .i { margin-top: 2px; }
.pg-inc-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.pg-drop { position: relative; }
.pg-drop > summary { list-style: none; user-select: none; }
.pg-drop > summary::-webkit-details-marker { display: none; }
.pg-drop[open] > summary { border-color: var(--blue); color: var(--blue); }
.pg-drop-m {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 170px; padding: 6px;
  background: var(--raised); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column;
}
.pg-drop-m button {
  text-align: left; background: none; border: none; color: var(--soft); font-size: 13px; font-weight: 600;
  padding: 8px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.pg-drop-m button:hover, .pg-drop-m button:focus-visible { background: var(--inset); color: var(--text); outline: none; }
.pg-mute .i { flex: none; margin-top: 2px; }

/* ——— сессии ——— */
.pg-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.pg-q { flex: 1 1 260px; max-width: 360px; display: block; }
.pg-seg { display: flex; gap: 8px; }
.pg-seg .btn { min-width: 52px; justify-content: center; }
.pg-count { font-size: 13px; margin: 0 0 8px; min-height: 18px; }
.pg-ses td small, .pg-ctrls td small, .pg-sts td small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 400; }
.pg-ses td:first-child { white-space: nowrap; }
.pg-ses td:first-child b { font-weight: 600; }
.pg-ses td:nth-child(2) a { font-weight: 600; }
.pg-ses td.r { white-space: nowrap; }
.pg-ses td:last-child { min-width: 220px; }
.pg-out { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pg-chart { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.pg-more { display: flex; justify-content: center; margin-top: 14px; }

/* ——— диагностика ——— */
/* тон значения rows() (в app.css .rows .v сильнее .t-*) */
.pg-diag .rows .v.t-good { color: var(--good); } .pg-diag .rows .v.t-red { color: var(--red); }
.pg-diag .rows .v.t-amber { color: var(--amber); } .pg-diag .rows .v.t-teal { color: var(--teal); }
.pg-sub-h { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin: 18px 0 8px; }
.pg-alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; background: var(--inset); border: 1px solid var(--border); }
.pg-alert + .pg-alert { margin-top: 8px; }
.pg-alert > span { padding-top: 2px; }
.pg-alert b { display: block; font-size: 14px; font-weight: 600; }
.pg-alert div span { display: block; font-size: 13px; color: var(--soft); margin-top: 4px; overflow-wrap: anywhere; }
.pg-alert small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.pg-ok { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.pg-card-act { display: flex; justify-content: flex-end; margin-top: 14px; }
.pg-bus .card-h .right { font-size: 13px; }
.pg-bus .card-h h2 { overflow-wrap: anywhere; }
.pg-revoked { opacity: .7; }
.pg-ctrls td, .pg-sts td { white-space: nowrap; }
.pg-ctrls td:last-child { white-space: normal; color: var(--soft); }

@media (max-width: 860px) {
  .pg-inc { grid-template-columns: 36px minmax(0, 1fr); padding: 14px; }
  .pg-inc-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; padding-top: 0; }
  .pg-hist { grid-template-columns: 20px minmax(0, 1fr); }
  .pg-hist-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; white-space: normal; }
  .pg-q { max-width: none; flex-basis: 100%; }
  .pg-bar .select { flex: 1 1 auto; }
}
