/* Дополнение к panel.css — классы, которых в эталоне ещё нет.
   Те же переменные, та же плотность, никаких новых цветов:
   цвет остаётся только смысловым. */

/* ── Сигналы ── */
.sig-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }

.sig {
  display: grid;
  grid-template-columns: 3px 1fr auto;
  gap: 0 16px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px 14px 15px;
  box-shadow: var(--shadow-sm);
}
.sig::before { content: ""; align-self: stretch; border-radius: 2px; background: var(--line-2); }
.sig.critical::before { background: var(--down); }
.sig.warning::before  { background: var(--muted); }

.sig-text { min-width: 0; }
.sig-title { font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.sig-why   { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.sig-act { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.sig-when { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.sig-when.now { color: var(--down); }

/* ── Метка типа сигнала ── */
.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* ── Свёрнутый остаток списка ── */
.more { margin-bottom: 22px; }
.more > summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 0;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover { color: var(--ink); }
.more[open] > summary { margin-bottom: 10px; }

/* ── Пусто ── */
.empty {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

/* ── Мелкие утилиты ── */
.sec { margin: 26px 0 12px; font-size: 15.5px; font-weight: 600; color: var(--ink); }
.sec:first-child { margin-top: 0; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.stale { font-size: 12.5px; color: var(--muted); }

/* ── Матрица остатков: товар × точка ── */
.scroll { overflow-x: auto; border-radius: var(--radius); margin-bottom: 22px; }
.scroll table { margin-bottom: 0; }

.matrix th.loc { text-align: center; min-width: 86px; }
.matrix th.loc span { display: block; text-transform: none; letter-spacing: normal;
  font-weight: 500; font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }
.matrix td.name { min-width: 220px; }
.matrix td.cell { text-align: center; padding: 10px 8px; }

.q { font-size: 13.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.d { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Цвет только смысловой: пусто и «вот-вот кончится» — приглушённый красный,
   залежавшееся — серое, норма — без выделения. */
.cell.empty  { background: #fbf4f3; }
.cell.empty  .q { color: var(--down); }
.cell.low    .q { color: var(--down); }
.cell.excess .q, .cell.excess .d { color: var(--muted); }
.cell.idle   .q, .cell.idle   .d { color: var(--muted-2); }
.cell.none   { color: var(--line-2); }

/* Итоговая строка по точке */
.matrix tfoot td { background: #fafbfc; font-size: 12px; color: var(--muted); text-align: center; }
.matrix tfoot td.name { text-align: left; font-weight: 600; color: var(--ink); }

/* Легенда */
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 0 0 18px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px;
  vertical-align: middle; background: var(--line-2); }
.legend .e i { background: var(--down); }
.legend .x i { background: var(--muted-2); }

/* ── Вход ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.login-brand { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.login-card .sub { margin: 4px 0 20px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px;
  color: var(--muted); font-weight: 550; }
.login-form button { margin-top: 6px; }
.login-error { background: #fbf4f3; border: 1px solid #f0e2e0; color: var(--down);
  border-radius: var(--radius-sm); padding: 10px 13px; font-size: 13px; margin-bottom: 16px; }

/* Имя пользователя и выход в сайдбаре */
.sb-user .who { font-size: 13px; font-weight: 600; color: var(--ink); }
.sb-user .role { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.sb-user .out { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.sb-user .out:hover { color: var(--ink); }
