/* iS express — демо операционной системы. Общие стили. */

:root {
  color-scheme: light;

  /* Бренд (с логотипа компании) */
  --brand-blue: #1e3a8c;
  --brand-blue-700: #16296b;
  --brand-blue-50: #eef2fb;
  --brand-red: #b4162f;
  --brand-red-50: #fdeef1;

  /* Поверхности и текст */
  --surface: #ffffff;
  --page: #f4f6fa;
  --ink: #0e1420;
  --ink-2: #52596b;
  --muted: #8a91a3;
  --line: #e3e7ef;
  --line-strong: #cdd4e2;

  /* Серии данных (валидированная палитра, CVD-safe) */
  --series-1: #2a78d6;
  --series-2: #eb6834;

  /* Статусы (icon + label обязательны, цвет не несёт смысл в одиночку) */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(14, 20, 32, .06), 0 8px 24px rgba(14, 20, 32, .05);
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

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

/* ─────────────── Демо-панель ─────────────── */

.demobar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
}

.demobar__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 100px;
  background: var(--brand-red);
  font-weight: 700;
  letter-spacing: .04em;
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
}

.demobar__nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.demobar__nav::-webkit-scrollbar { display: none; }

.demobar__nav a {
  color: rgba(255, 255, 255, .72);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}
.demobar__nav a:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.demobar__nav a[aria-current="page"] { background: rgba(255, 255, 255, .16); color: #fff; font-weight: 600; }

.demobar__note {
  margin-left: auto;
  color: rgba(255, 255, 255, .55);
  font-size: 12px;
}

/* ─────────────── Логотип ─────────────── */

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }

.logo__mark {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-red);
  color: #fff;
  font-weight: 800;
  font-size: 21px;
  line-height: 1;
  letter-spacing: -.02em;
  border-radius: 3px;
  flex: none;
}
.logo__mark span { font-weight: 700; }

.logo__word {
  display: flex; flex-direction: column; line-height: 1;
}
.logo__word b {
  color: var(--brand-blue);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.logo__word i {
  color: var(--brand-red);
  font-style: normal;
  font-size: 8.5px;
  letter-spacing: .22em;
  margin-top: 3px;
  text-transform: uppercase;
}
.logo--sm .logo__mark { width: 32px; height: 32px; font-size: 16px; }
.logo--sm .logo__word b { font-size: 19px; }
.logo--sm .logo__word i { font-size: 7px; }

/* ─────────────── Каркас ─────────────── */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar__in {
  max-width: 1240px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 16px;
}
.topbar__spacer { margin-left: auto; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 20px 64px; }
.wrap--narrow { max-width: 880px; }

.page-title { font-size: 22px; font-weight: 700; margin: 0 0 2px; letter-spacing: -.01em; }
.page-sub { color: var(--ink-2); margin: 0 0 20px; font-size: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.card__title { font-size: 15px; font-weight: 650; margin: 0; }
.card__sub { font-size: 12.5px; color: var(--muted); margin: 2px 0 0; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }

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

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

.btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--brand-blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
  transition: background .12s ease;
}
.btn:hover { background: var(--brand-blue-700); }
.btn--ghost { background: transparent; color: var(--brand-blue); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--brand-blue-50); }
.btn--red { background: var(--brand-red); }
.btn--red:hover { background: #920f25; }
.btn--lg { font-size: 16px; padding: 13px 22px; }
.btn--block { width: 100%; justify-content: center; }
.btn--sm { font-size: 13px; padding: 6px 12px; }

.field { display: block; margin-bottom: 13px; }
.field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; font-weight: 550; }
.input, select.input, textarea.input {
  width: 100%;
  font: inherit;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
.input:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; border-color: var(--brand-blue); }

/* ─────────────── Бейджи статусов ─────────────── */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before { content: attr(data-icon); font-size: 11px; line-height: 1; }
.badge--new { background: var(--brand-blue-50); color: #16296b; border-color: #d3ddf5; }
.badge--work { background: #fff5e6; color: #8a5a00; border-color: #f7dfb4; }
.badge--done { background: #e9f7e9; color: #0a6b0a; border-color: #c2e6c2; }
.badge--fail { background: #fdecec; color: #972929; border-color: #f4c9c9; }
.badge--partner { background: #f1eefb; color: #4a3aa7; border-color: #ddd6f5; }
.badge--muted { background: #f1f3f8; color: var(--ink-2); border-color: var(--line); }

/* ─────────────── Таблицы ─────────────── */

.table-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  font-weight: 650;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #fbfcfe;
}
table.tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.tbl tbody tr:hover { background: #f8fafd; }
table.tbl tbody tr:last-child td { border-bottom: none; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; font-weight: 600; }

/* ─────────────── Прочее ─────────────── */

.kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: #f1f3f8;
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 5px;
}

.hint {
  font-size: 12.5px;
  color: var(--muted);
}

.note {
  background: var(--brand-blue-50);
  border: 1px solid #d3ddf5;
  border-left: 3px solid var(--brand-blue);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  color: #1c2a4d;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 100px;
  font-size: 13.5px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 200;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal-back {
  position: fixed; inset: 0;
  background: rgba(14, 20, 32, .5);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  z-index: 100;
}
.modal-back.is-on { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  margin: auto 0;
}
.modal__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal__body { padding: 20px; }
.modal__foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end;
  background: #fbfcfe;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.x {
  appearance: none; border: none; background: none;
  font-size: 22px; line-height: 1; color: var(--muted);
  cursor: pointer; padding: 4px 8px;
}

@media (max-width: 960px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid--4 { grid-template-columns: 1fr; }
  .demobar__note { display: none; }
  .wrap { padding: 16px 14px 48px; }
}
