/* ЭЛЕРА — современный деловой интерфейс */
:root {
  --navy: #12314e;
  --navy-2: #0c2438;
  --blue: #1d5c96;
  --gold: #d99a1b;
  --gold-soft: #f7edd8;
  --bg: #f2f4f7;
  --card: #ffffff;
  --line: #e3e8ee;
  --text: #1b2430;
  --muted: #66727f;
  --green: #177a3e;
  --green-soft: #e4f4ea;
  --red: #b03434;
  --red-soft: #fae7e7;
  --amber: #8a6d1a;
  --amber-soft: #f6efdb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 35, 56, .05), 0 4px 16px rgba(16, 35, 56, .06);
  --shadow-pop: 0 8px 30px rgba(16, 35, 56, .18);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "PT Sans", Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 22px; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--navy); }

/* ── шапка ─────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(135deg, var(--navy-2) 0%, var(--navy) 60%, #17436b 100%);
  box-shadow: 0 2px 12px rgba(12, 36, 56, .25);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 14px; padding-bottom: 14px; }
.brand { color: #fff; text-decoration: none; font-size: 25px; font-weight: 800; letter-spacing: 3px; }
.brand-sub { font-size: 13px; font-weight: 400; letter-spacing: .3px; margin-left: 12px; color: #9db4c9; text-transform: uppercase; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  color: #d5e1ec; text-decoration: none; font-size: 15.5px;
  padding: 7px 14px; border-radius: 8px; transition: background .15s, color .15s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a.active { color: #fff; background: rgba(255, 255, 255, .14); box-shadow: inset 0 -2px 0 var(--gold); }
.nav a.muted { color: #8ba1b5; }

main { padding: 30px 22px 48px; }
h1 { font-size: 28px; margin: 0 0 10px; color: var(--navy); letter-spacing: -.3px; }
h2 { font-size: 20px; color: var(--navy); margin: 26px 0 12px; }
.lead { color: var(--muted); margin: 0 0 8px; max-width: 760px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-badge {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 22px; text-align: center; min-width: 150px;
}
.stat-num { display: block; font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat-cap { color: var(--muted); font-size: 13.5px; }

/* ── фильтры ───────────────────────────── */
.filters {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px 16px; margin-bottom: 20px;
}
.filters-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 5px 2px; }
.field select, .field input {
  padding: 10px 12px; font-size: 15.5px; border: 1.5px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--text); transition: border-color .15s;
}
.field select:focus, .field input:focus, .dd-search:focus { outline: none; border-color: var(--blue); }
.range { display: flex; gap: 8px; }
.range input { width: 105px; }
.range input[type=date] { width: 165px; min-width: 165px; font-variant-numeric: tabular-nums; }
.field-submit { margin-left: auto; }

/* выпадающие фильтры с поиском */
.dd { position: relative; }
.dd-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; font-size: 15.5px; cursor: pointer;
  background: #fff; color: var(--text); border: 1.5px solid var(--line); border-radius: 9px;
  transition: border-color .15s, box-shadow .15s;
}
.dd-btn:hover { border-color: #b9c4d0; }
.dd-btn.has-value { border-color: var(--blue); color: var(--navy); font-weight: 600; }
.dd-count {
  display: none; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--blue); color: #fff; font-size: 13px; font-weight: 700;
}
.dd-arrow { width: 8px; height: 8px; border-right: 2px solid #9aa7b4; border-bottom: 2px solid #9aa7b4; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.dd.open .dd-arrow { transform: rotate(-135deg) translateY(-2px); }
.dd-panel {
  display: none; position: absolute; z-index: 40; top: calc(100% + 6px); left: 0;
  width: 300px; max-height: 360px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop);
  padding: 10px;
}
.dd.open .dd-panel { display: flex; flex-direction: column; }
.dd-search {
  width: 100%; padding: 9px 12px; font-size: 15px;
  border: 1.5px solid var(--line); border-radius: 8px; margin-bottom: 8px;
}
.dd-list { overflow-y: auto; }
.dd-list label {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 8px; cursor: pointer; font-size: 15.5px;
}
.dd-list label:hover { background: #f1f5f9; }
.dd-list input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--blue); flex-shrink: 0; }
.dd-list label span { flex: 1; }
.dd-list label em { font-style: normal; color: var(--muted); font-size: 13px; }
.dd-hint { color: var(--muted); font-size: 13.5px; line-height: 1.45; margin: 8px 4px 2px; padding-top: 8px; border-top: 1px dashed var(--line); }

/* плашки применённых фильтров */
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.chips-label { color: var(--muted); font-size: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: #eaf1f8; color: var(--navy); border: 1px solid #cfdeec;
  padding: 5px 12px; border-radius: 16px; font-size: 14.5px; text-decoration: none;
  transition: background .15s;
}
.chip:hover { background: #dce8f4; }
.chip-x { font-size: 17px; line-height: 1; color: var(--blue); font-weight: 700; }
.chips-clear { font-size: 14px; color: var(--muted); margin-left: 4px; }

/* быстрые подборки-пресеты */
.presets { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.presets-label { color: var(--muted); font-size: 14.5px; }
.preset {
  display: inline-block; background: var(--card); color: var(--navy);
  border: 1.5px solid var(--line); border-radius: 20px; padding: 8px 18px;
  font-size: 15px; font-weight: 600; text-decoration: none; box-shadow: var(--shadow);
  transition: border-color .15s, transform .1s;
}
.preset:hover { border-color: var(--gold); transform: translateY(-1px); }
.preset-on { border-color: var(--navy); background: var(--navy); color: #fff; }
.bell { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 1px 8px; font-size: 13px; font-weight: 700; }

/* ── кнопки ────────────────────────────── */
.btn {
  display: inline-block; background: linear-gradient(180deg, #1c497a, var(--navy)); color: #fff;
  border: 0; border-radius: 9px; padding: 11px 26px; font-size: 15.5px; font-weight: 600;
  cursor: pointer; text-decoration: none; box-shadow: 0 2px 6px rgba(18, 49, 78, .25);
  transition: transform .1s, box-shadow .15s, filter .15s;
}
.btn:hover { filter: brightness(1.12); box-shadow: 0 4px 12px rgba(18, 49, 78, .3); }
.btn:active { transform: translateY(1px); }
.btn-light { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); box-shadow: none; }
.btn-light:hover { background: #f0f4f8; filter: none; }
.btn-small { padding: 6px 14px; font-size: 14px; }

/* ── таблицы ───────────────────────────── */
.card-block, .table-block {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th {
  text-align: left; background: #f6f8fa; color: var(--muted);
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700;
}
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
tr.rowlink { cursor: pointer; }
tbody tr:hover td { background: #f4f8fc; }
td.num, th.num { text-align: right; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.cell-tags { max-width: 190px; }

.status { display: inline-block; padding: 3px 11px; border-radius: 13px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.status-ok { background: var(--green-soft); color: var(--green); }
.status-bad { background: var(--red-soft); color: var(--red); }
.status-mid { background: var(--amber-soft); color: var(--amber); }
.tag {
  display: inline-block; background: #eef2f6; color: var(--navy);
  border-radius: 6px; padding: 2px 9px; margin: 1px 3px 1px 0; font-size: 13.5px; white-space: nowrap;
}
.tag-more { background: var(--gold-soft); color: var(--amber); }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }

.pager { margin: 20px 0; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.pager a, .pager span.cur {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 8px;
  text-decoration: none; background: #fff; font-size: 15px;
}
.pager a:hover { border-color: var(--blue); }
.pager span.cur { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 700; }
.pager .dots { color: var(--muted); }

/* ── карточка ──────────────────────────── */
.kv { display: grid; grid-template-columns: 240px 1fr; }
.kv > div { padding: 11px 18px; border-bottom: 1px solid var(--line); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv > div:nth-child(odd) { color: var(--muted); font-size: 14.5px; }
.badge-active { background: var(--green-soft); color: var(--green); padding: 4px 13px; border-radius: 13px; font-size: 13.5px; font-weight: 600; }
.notice {
  background: var(--gold-soft); border: 1px solid #eadfc0;
  padding: 14px 18px; border-radius: var(--radius); margin: 16px 0;
}
.notice-green { background: var(--green-soft); border-color: #c4e2cf; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv > div:nth-child(odd) { border-bottom: 0; padding-bottom: 2px; }
  .field-submit { margin-left: 0; width: 100%; }
  .field-submit .btn { width: 100%; }
  .dd-panel { width: min(300px, calc(100vw - 60px)); }
  body { font-size: 16px; }
}

/* ── шаги подключения ──────────────────── */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin: 24px 0; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; transition: transform .15s, box-shadow .15s;
}
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), #b57b0e); color: #fff;
  font-size: 20px; font-weight: 800; margin-bottom: 14px;
}
.step h3 { margin: 0 0 8px; font-size: 17.5px; color: var(--navy); }

.footer { background: var(--navy-2); color: #9db4c9; margin-top: 34px; }
.footer .wrap { padding: 24px 22px; }
.footer p { margin: 4px 0; font-size: 15px; }
.footer strong { color: #d5e1ec; }

/* ── формы ─────────────────────────────── */
.form-narrow {
  max-width: 440px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px;
}
.form-narrow label { display: block; margin: 14px 0 5px; color: var(--muted); font-size: 14.5px; }
.form-narrow input {
  width: 100%; padding: 11px 13px; font-size: 16.5px;
  border: 1.5px solid var(--line); border-radius: 9px;
}
.form-narrow input:focus { outline: none; border-color: var(--blue); }
.error { color: var(--red); margin-top: 10px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form > div { flex: 1 1 130px; }
.inline-form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.inline-form input {
  width: 100%; padding: 9px 11px; font-size: 15px;
  border: 1.5px solid var(--line); border-radius: 8px;
}
pre {
  background: #f6f8fa; border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.5;
}
