/*  Кабинет охранной компании — в духе Apple: воздух, крупные цифры,
    белые карточки на светло-сером фоне, списки как в «Настройках».

    Руководитель заходит сюда раз в неделю: завести сотрудника, посмотреть
    сводку, отозвать кнопку. Общая основа — /vendor/safe/ui.css. */

body { font-size: 15px; }

/* ── Шапка ────────────────────────────────────────────────────────────── */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 60px;
  padding: 0 max(24px, calc((100% - 1180px) / 2));
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: inset 0 -.5px 0 var(--sep);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand__mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 22.5%;
  background: url("/vendor/safe/icon-192.png") center / cover no-repeat;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .14);
  font-size: 0;
  color: transparent;
}

.brand b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand span:not(.brand__mark) { display: block; color: var(--label-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand > div { min-width: 0; }

.top__right { display: flex; align-items: center; gap: 16px; }
.me { color: var(--label-2); font-size: 13px; }

/* ── Кнопки ───────────────────────────────────────────────────────────── */

button {
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: filter .2s, background .2s, transform .15s var(--ease);
}

button:hover { filter: brightness(1.08); }
button:active { transform: scale(.98); }

/* Второстепенные действия — текстом, как в macOS. */
.ghost {
  height: auto;
  padding: 6px 0;
  background: transparent;
  color: var(--blue-text);
  font-size: 14px;
  font-weight: 500;
}

.ghost:hover { filter: none; opacity: .72; }

/* Действие в строке списка: серая капсула. «Убрать» и «Отозвать» — красным
   текстом: это необратимо. */
.ghost--small {
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--red-text);
  font-size: 13px;
  font-weight: 600;
}

.ghost--small:hover { opacity: 1; background: var(--fill-hover); }

/* ── Страница ─────────────────────────────────────────────────────────── */

.wrap { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 36px 0 80px; }

.page-head { margin: 4px 0 24px; }
.page-head h1 { margin: 0; font-size: clamp(30px, 4vw, 40px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.page-head p { margin: 6px 0 0; color: var(--label-2); font-size: 17px; }

/* Сводка: крупные цифры — то, что руководитель показывает собственнику. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 36px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 112px;
  padding: 18px 20px;
  border-radius: var(--r-l);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.stat b {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.stat span { margin-top: auto; color: var(--label-2); font-size: 13px; line-height: 1.35; }

/* Первая цифра — главная: среднее время прибытия. */
#stats .stat:first-child b { color: var(--blue-text); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.panel {
  padding: 24px 24px 20px;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.panel h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.025em;
}

.panel__lead { margin: 0 0 14px; color: var(--label-2); font-size: 14px; line-height: 1.45; }

.count { height: 22px; padding: 0 8px; }

/* Списки — строки с тонкими разделителями, как в «Настройках». */
.list { display: block; }

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  box-shadow: inset 0 -.5px 0 var(--sep);
}

.item:last-child { box-shadow: none; }

.item > div:first-child { min-width: 0; }
.item b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.012em; }
.item span { color: var(--label-2); font-size: 13px; }
.item__right { display: flex; align-items: center; gap: 10px; flex: none; }
.item__right .tag { font-size: 11.5px; }

.phone { font: 13px var(--mono); color: var(--label-2); font-variant-numeric: tabular-nums; }

.empty { padding: 18px 0; color: var(--label-2); font-size: 14px; }

/* Формы добавления — свёрнуты: список читается, пока форма не нужна. */
.add { margin-top: 10px; border-top: .5px solid var(--sep); }

.add summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 4px;
  color: var(--blue-text);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.add summary::-webkit-details-marker { display: none; }

.add summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  transition: transform .25s var(--ease);
}

.add[open] summary::before { transform: rotate(45deg); }

.add__body { display: grid; gap: 10px; margin-top: 14px; animation: reveal .3s var(--ease); }
.add__body > button { justify-self: start; min-width: 140px; }

@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.check { display: flex; gap: 10px; align-items: flex-start; padding: 4px 2px; font-size: 14px; color: var(--label-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--blue); flex: none; }

.hint { min-height: 18px; color: var(--label-2); font-size: 13px; line-height: 1.45; }

/* Секрет кнопки показывается один раз — выделен. */
.secret {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--r-m);
  background: color-mix(in srgb, var(--orange) 12%, transparent);
  font-size: 13px;
}

.secret b { color: var(--orange-text); }
.secret code { font: 13px var(--mono); word-break: break-all; color: var(--label); }
.secret__link { color: var(--label-2); word-break: break-all; font-size: 12px; }

/* ── Отчёт за период ──────────────────────────────────────────────────── */

/* Отчёт во всю ширину: таблицу в узкой колонке читать нельзя. */
.panel--wide { grid-column: 1 / -1; }

.report__controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 18px; }
.report__controls select { width: auto; min-width: 220px; height: 40px; }

.stats--report { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 22px; }
.stats--report .stat { min-height: 96px; padding: 14px 16px; background: var(--fill-soft); box-shadow: none; border-radius: var(--r-m); }
.stats--report .stat b { font-size: 24px; }

/* Таблица может быть шире экрана: прокручиваем её, а не ломаем вёрстку. */
.report__table-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }

.report { width: 100%; border-collapse: collapse; font-size: 14px; }

.report th {
  padding: 8px 12px;
  text-align: left;
  color: var(--label-2);
  font-size: 12px;
  font-weight: 600;
  box-shadow: inset 0 -.5px 0 var(--sep-strong);
  white-space: nowrap;
}

.report td { padding: 11px 12px; box-shadow: inset 0 -.5px 0 var(--sep); vertical-align: top; }
.report tbody tr:hover td { background: var(--fill-soft); }
.report .nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.report .empty { text-align: center; padding: 26px; }

/* ── Телефон ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .top { padding: 0 16px; }
  .me { display: none; }
  .wrap { width: calc(100% - 32px); padding-top: 24px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { min-height: 100px; padding: 14px 16px; }
  .stat b { font-size: 26px; }
  .panel { padding: 20px 18px 16px; border-radius: var(--r-l); }
  .item { flex-wrap: wrap; }
  .item__right { width: 100%; justify-content: space-between; }
  .row { grid-template-columns: 1fr; }
  .report__controls > * { flex: 1 1 auto; }
}
