:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1d2330;
  --muted: #6b7280;
  --line: #e3e6eb;
  --accent: #0b6bcb;
  --accent-text: #ffffff;
  --ok: #157f3b;
  --warn: #a15c00;
  --bad: #b42318;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.topbar {
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.who { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 14px; }
.container { max-width: 960px; margin: 0 auto; padding: 20px 16px 40px; }
.narrow { max-width: 420px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
h1 { font-size: 22px; margin: 0 0 16px; }
.muted { color: var(--muted); }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: #e8f1fb; color: var(--accent); font-weight: 600;
}
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; background: #eef2f7; }
.alert-error { background: #fdecea; color: var(--bad); }
.alert-success { background: #e7f6ec; color: var(--ok); }
.alert-warning { background: #fff4e5; color: var(--warn); }
form p { margin: 0 0 14px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=tel], input[type=email], input[type=number],
input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.helptext, .errorlist { font-size: 13px; }
.errorlist { color: var(--bad); padding-left: 18px; margin: 4px 0 0; }
button, .btn {
  display: inline-block; padding: 10px 18px; font-size: 16px; font-weight: 600;
  border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-text); cursor: pointer;
  text-decoration: none;
}
button.wide { width: 100%; }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 400; font-size: inherit; }
form.inline { display: inline; margin: 0; }
.choice-list { display: grid; gap: 10px; }
.choice-list button { width: 100%; text-align: left; padding: 16px; font-size: 18px; }
.choice-list .sub { display: block; font-size: 14px; font-weight: 400; opacity: .85; }

textarea { font: inherit; resize: vertical; }
.container.wide { max-width: 1200px; }

/* Меню раздела (панель владельца и др.) */
.subnav {
  display: flex; gap: 4px; overflow-x: auto; padding: 0 12px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.subnav a {
  padding: 10px 12px; white-space: nowrap; text-decoration: none; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.subnav a.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.page-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-secondary, button.btn-secondary { background: #e8edf3; color: var(--text); }
.btn-danger, button.btn-danger { background: var(--bad); color: #fff; }
.btn-small, button.btn-small { padding: 6px 12px; font-size: 14px; }
section.card { margin-bottom: 16px; }
section.card h2 { font-size: 18px; margin: 0 0 12px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grid-2 > * { min-width: 0; }
dl.props { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; }

/* Таблицы: на телефоне прокручиваются по горизонтали */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data tfoot td { font-weight: 700; border-bottom: 0; }
table.data tr.off td { color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 13px; background: #eef2f7; color: var(--muted); }
.tag-ok { background: #e7f6ec; color: var(--ok); }
.tag-warn { background: #fff4e5; color: var(--warn); }
.tag-bad { background: #fdecea; color: var(--bad); }
.small { font-size: 13px; }
.kv { margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }

/* Фильтры журнала */
form.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; margin-bottom: 16px; }
form.filters p { margin: 0; }

/* Временный пароль — один раз на экране */
.secret { font-size: 32px; font-weight: 700; letter-spacing: 4px; font-family: ui-monospace, Consolas, monospace;
  padding: 12px 16px; background: #f1f5fb; border-radius: var(--radius); text-align: center; margin: 12px 0; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; }

/* Кабинет компании */
.text-bad { color: var(--bad); }
form.search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
form.search input[type=search] { flex: 1 1 220px; padding: 10px 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; }
.container.notice { padding-bottom: 0; }
.container.notice .alert { margin: 0; }
table.data td input[type=text] { min-width: 110px; padding: 6px 10px; }
