/* Переменные, типографика, каркас страницы. */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #dfe4ea;
  --border-strong: #c2cad3;
  --text: #1c2430;
  --text-dim: #6b7684;
  --accent: #1f6feb;
  --accent-dark: #1857bd;
  --ok: #1e8e4a;
  --warn: #b8860b;
  --danger: #c0392b;
  --phase1: #8a6d3b;
  --phase2: #1f6feb;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .06);
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 20px; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 16px; margin: 0 0 10px; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 650; color: var(--text-dim); }

.is-hidden { display: none !important; }
.muted { color: var(--text-dim); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ─── Вход ─────────────────────────────────────────────────────────────── */

.login {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #eef2f7, #dde5ee);
}

.login__box {
  width: 320px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 28px 26px;
}

.login__brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .4px;
  margin-bottom: 22px;
  text-align: center;
}
.login__brand span { color: var(--accent); }

.login__error {
  color: var(--danger);
  min-height: 18px;
  font-size: 13px;
  margin: 4px 0 10px;
}

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

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 52px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__brand {
  font-weight: 700;
  letter-spacing: -.2px;
  color: var(--accent);
  white-space: nowrap;
  user-select: none;
}

.topbar__version {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
  vertical-align: middle;
}

/* Индикатор связи с сервером. Серый — ещё не проверяли. */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 8px;
  vertical-align: middle;
  background: #9ca3af;
  cursor: pointer;
  transition: background .3s;
}
.live-dot--ok { background: var(--ok); }
.live-dot--error { background: var(--danger); }
.live-dot--unknown { background: #9ca3af; }

.topbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.whoami {
  font: inherit;
  font-size: 13px;
  color: var(--text-dim);
  text-align: right;
  line-height: 1.2;
  background: none;
  border: none;
  border-radius: var(--radius);
  padding: 4px 8px;
  cursor: pointer;
}
.whoami:hover { background: var(--surface-2); }
.whoami b { display: block; color: var(--text); font-weight: 600; }
.whoami__chevron { color: var(--text-dim); font-weight: 400; }

.nav { display: flex; gap: 2px; }

.nav__item {
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-weight: 500;
  cursor: pointer;
}
.nav__item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav__item.is-active { background: #e8f0fe; color: var(--accent); }

.bell {
  position: relative;
  background: none;
  border: none;
  font-size: 17px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius);
}
.bell:hover { background: var(--surface-2); }

.bell__count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: #fff;
  border-radius: 9px;
  font-size: 10px;
  line-height: 1;
  padding: 3px 5px;
  font-weight: 700;
}

/* ─── Полотно ──────────────────────────────────────────────────────────── */

/* Полотно — во всю ширину окна: у сделок полтора десятка колонок, и лишние
   поля по краям на широком мониторе отнимали место у самих данных. */
.view { padding: 18px 24px; }

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.page-head__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 90;
}
