/* Палитра та же, что на странице оплаты: сайт и кабинет должны выглядеть одним
   продуктом. Шрифт — IBM Plex Sans, тот же, что в iOS-приложении и на лендинге:
   единственный шрифт бренда, у которого есть полноценная кириллица (у
   Plus Jakarta Sans, которым раньше пользовалась страница оплаты, кириллицы нет
   вообще — там просто незаметно работал системный фолбэк). Файлы лежат тут же,
   не тянутся с чужого домена: font-src в CSP разрешает только 'self'. */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-sans-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-sans-cyrillic-500-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-sans-cyrillic-700-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}

:root {
  --bg: #0C0E12;
  --panel: #181A21;
  --panel-inner: rgba(33, 36, 44, 0.6);
  --line: #252831;
  --line-soft: rgba(37, 40, 49, 0.4);
  --tab: #21242C;
  --text: #F3F5F7;
  --text-dim: #7E8A9A;
  --footnote: rgba(126, 138, 154, 0.7);
  --blue: #2A6DF4;
  --blue-line: rgba(42, 109, 244, 0.6);
  --green: #37B26B;
  --red: #E5484D;
  --gold: #F9C31F;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 32px 24px 64px;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1100px; margin: 0 auto; }
.narrow { max-width: 460px; }

a { color: var(--blue); }

h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
h2 { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.subtitle { margin: 0 0 28px; color: var(--text-dim); font-size: 15px; }
.muted { color: var(--text-dim); font-size: 14px; }
.footnote { color: var(--footnote); font-size: 12px; }

/* --- шапка --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 28px; padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--tab);
  color: var(--text);
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.nav a.active { border-color: var(--blue-line); }
.who { color: var(--text-dim); font-size: 13px; }

/* --- панели --- */
.panel {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.panel + .panel { margin-top: 18px; }
.panel-danger { border-color: rgba(229, 72, 77, 0.35); }
.panel-danger h2 { color: var(--red); }

.grid { display: grid; gap: 14px; }
/* нижний отступ, иначе панель под карточками прилипает к ним вплотную */
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 18px; }

.stat {
  padding: 16px 18px;
  background: var(--panel-inner);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}
.stat .value { font-size: 24px; font-weight: 700; }
.stat .label { margin-top: 4px; color: var(--text-dim); font-size: 13px; }

/* --- формы --- */
label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--text-dim); }

input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"] {
  width: 100%;
  padding: 13px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: 400 15px "IBM Plex Sans", system-ui, -apple-system, sans-serif;
}
input:focus { outline: none; border-color: var(--blue-line); }
input.code { letter-spacing: 0.3em; text-align: center; font-size: 20px; }

select {
  width: 100%;
  height: 46px; /* как у текстовых полей, иначе select выходит на 2px выше */
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: 400 15px "IBM Plex Sans", system-ui, -apple-system, sans-serif;
}
select:focus { outline: none; border-color: var(--blue-line); }

.field + .field { margin-top: 14px; }

button, .btn {
  display: inline-block;
  padding: 13px 20px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font: 700 15px "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button.wide { width: 100%; margin-top: 18px; }
/* ссылка-кнопка (скачивание бэкапа) выглядит так же, как обычная кнопка */
button.ghost, .btn.ghost {
  background: var(--tab);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 500;
}
button.danger { background: transparent; border: 1px solid rgba(229, 72, 77, 0.4); color: var(--red); font-weight: 600; }

/* --- сообщения --- */
.error, .notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
}
.error { background: rgba(229, 72, 77, 0.1); border: 1px solid rgba(229, 72, 77, 0.35); color: #FF9A9D; }
.notice { background: var(--panel-inner); border: 1px solid var(--line-soft); color: var(--text-dim); }
.notice code { word-break: break-all; color: var(--text); }

/* --- таблицы --- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  padding: 10px 12px; text-align: left;
  color: var(--text-dim); font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.scroll { overflow-x: auto; }

.pill {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.pill.ok { background: rgba(55, 178, 107, 0.15); color: var(--green); }
.pill.warn { background: rgba(249, 195, 31, 0.15); color: var(--gold); }
.pill.off { background: rgba(126, 138, 154, 0.15); color: var(--text-dim); }

.steps { margin: 16px 0 0; padding-left: 20px; color: var(--text-dim); font-size: 14px; }
.steps li + li { margin-top: 8px; }
.steps li::marker { color: var(--blue); font-weight: 700; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row + .row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }

/* шапка блока сервера: название слева, общий вердикт справа */
.server-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }

.searchbar { display: flex; gap: 10px; margin-bottom: 16px; }
.searchbar input { flex: 1; }

/* --- сетки форм на экранах серверов и тарифов --- */
.fields { display: flex; flex-wrap: wrap; gap: 12px; }
.fields .field { flex: 1 1 180px; min-width: 140px; margin: 0; }
.fields .field.short { flex: 0 1 130px; min-width: 100px; }

textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: 400 14px "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  resize: vertical;
}
textarea:focus { outline: none; border-color: var(--blue-line); }

button.small, .btn.small { padding: 9px 14px; font-size: 13px; }

.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--blue); width: 16px; height: 16px; }

/* карточка одного тарифа */
.plans-list { display: grid; gap: 14px; margin-top: 16px; }
.plan-row {
  padding: 16px;
  background: var(--panel-inner);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}
.plan-row.is-off { opacity: 0.55; }
.plan-actions {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

/* --- устройства в кабинете --- */
.devices { display: grid; gap: 14px; margin-top: 16px; }
.device {
  padding: 16px;
  background: var(--panel-inner);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}
/* ссылка подписки длинная: без переноса она уезжает за край экрана телефона */
.device .link { margin: 12px 0; word-break: break-all; }

/* полоска последних проверок узла */
.ticks { display: inline-flex; gap: 3px; align-items: center; }
.ticks i {
  display: inline-block;
  width: 6px; height: 16px;
  border-radius: 2px;
  background: var(--line);
}
.ticks i.up { background: var(--green); }
.ticks i.down { background: var(--red); }

@media (max-width: 700px) {
  body { padding: 24px 16px 48px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  h1 { font-size: 22px; }
}
