/* МАЯК · Investigation view styles */

.inv-view {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  height: 100%;
  background: var(--bg);
}

/* ── case header ── */
.inv-case {
  display: flex; align-items: stretch; gap: 18px;
  padding: 12px 22px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.inv-case-l {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
  align-self: center;
}
.inv-case-num {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  outline: none;
  width: 12ch;
}
.inv-case-num:focus {
  background: var(--bg-sub);
  border-radius: 3px;
  box-shadow: 0 0 0 2px var(--accent-bg);
}
.inv-case-val {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg);
}
.inv-case-val b { font-family: var(--font-mono); font-weight: 600; }

/* ── body grid ── */
.inv-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 0;
}
.inv-rail {
  border-right: 1px solid var(--line);
  background: var(--paper);
  padding: 14px;
  display: flex; flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}
.inv-rail-section { display: flex; flex-direction: column; gap: 4px; }
.inv-rail .seg-toggle { display: grid; grid-template-columns: 1fr 1fr; }
.inv-rail .seg-toggle .seg-tab { justify-content: center; }
.inv-rail .range-tabs { display: grid; grid-template-columns: repeat(4, 1fr); }

.inv-main {
  overflow-y: auto;
  padding: 18px 22px;
}

/* picker */
.inv-picker { display: flex; flex-direction: column; gap: 8px; }
.inv-picker-list {
  display: flex; flex-direction: column;
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--paper);
}
.inv-pick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast);
}
.inv-pick-row:last-child { border-bottom: 0; }
.inv-pick-row:hover { background: var(--bg-sub); }
.inv-pick-row.on { background: var(--accent-bg); }
.inv-pick-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.inv-pick-label { font-size: 13px; font-weight: 500; }

/* timeline shared */
.inv-timeline { display: flex; flex-direction: column; gap: 14px; }

.inv-summary {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.inv-summary .stat-cell.sm {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 8px 12px;
}
.stat-value.danger { color: var(--danger); }
.stat-value.warn  { color: var(--warn); }

.inv-cat-row { display: flex; flex-wrap: wrap; gap: 4px; }
.inv-cat-row .cat-tag { padding: 4px 8px; font-size: 11.5px; }

/* sessions (user mode) */
.inv-sessions { display: flex; flex-direction: column; gap: 8px; }
.inv-session {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
  transition: box-shadow var(--t-fast);
}
.inv-session.open { box-shadow: var(--shadow-sm); }
.inv-session-head {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 14px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast);
}
.inv-session-head:hover { background: var(--bg-sub); }
.inv-session-icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 999px;
}
.inv-session-text { flex: 1; min-width: 0; }
.inv-session-title { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 13.5px; }
.inv-session-sub { font-size: 11px; margin-top: 2px; }
.inv-session-count { font-size: 11px; color: var(--muted); }
.inv-session-count b { font-family: var(--font-mono); font-weight: 600; color: var(--fg); }

/* days (beacon mode) */
.inv-days { display: flex; flex-direction: column; gap: 14px; }
.inv-day {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
}
.inv-day-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px;
  background: var(--bg-sub);
  border-bottom: 1px solid var(--line);
}
.inv-day-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
  text-transform: capitalize;
}

/* event row */
.inv-events {
  list-style: none;
  margin: 0; padding: 8px 0;
  display: flex; flex-direction: column;
}
.inv-event {
  display: grid;
  grid-template-columns: 14px 56px auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 14px;
  font-size: 12.5px;
  position: relative;
}
.inv-event + .inv-event {
  border-top: 1px dashed var(--line);
}
.inv-event-rail {
  position: relative;
  height: 100%;
  display: flex; justify-content: center;
}
.inv-event-rail .sev-bar {
  width: 2px;
  height: 100%;
  border-radius: 1px;
  min-height: 16px;
}
.inv-event-time { font-size: 11px; color: var(--muted); padding-top: 1px; }
.inv-event-text { min-width: 0; }

/* empty */
.inv-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--muted);
}
.inv-empty svg { color: var(--muted-2); }
.inv-empty p { margin: 0; }

/* mode toggle in audit screen toolbar */
.audit-mode {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-sub);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  margin-right: 6px;
}
.audit-mode-tab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  background: transparent; border: 0;
  color: var(--muted); cursor: pointer;
  font-size: 12.5px; font-weight: 500;
  border-radius: var(--r-1);
  transition: background var(--t-fast), color var(--t-fast);
}
.audit-mode-tab:hover { color: var(--fg); }
.audit-mode-tab.active {
  background: var(--paper);
  color: var(--fg);
  box-shadow: var(--shadow-sm);
}

/* responsive */
@media (max-width: 1100px) {
  .inv-body { grid-template-columns: 240px 1fr; }
  .inv-summary { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .inv-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .inv-rail { max-height: 320px; }
  .inv-case { flex-wrap: wrap; gap: 12px 16px; padding: 10px 14px; }
}
