/* Контраст и читаемость (NIPI-022): шрифт Inter (локально, OFL), крупнее базовый размер,
   тексты и границы с контрастом не ниже WCAG AA (4.5:1 для текста). Подключается после theme.css. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --text: #111827;        /* 17:1 на белом */
  --muted: #4b5563;       /* 7.5:1 */
  --border: #d4dae4;
  --primary: #1f3f8f;     /* 9:1 */
  --primary-dark: #162f6d;
  --primary-soft: #e3eafa;
  --bg: #eef1f6;
  --danger: #c62828;
  --success: #1b7a4a;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
button, input, select, textarea { font-family: inherit; }
strong, b { font-weight: 650; }
h1, h2, h3, .card-title { color: var(--text); letter-spacing: -0.01em; }

/* Подписи и подсказки */
label { color: #1f2937; font-size: 14px; font-weight: 600; }
label.checkbox, label.switch { font-weight: 500; }
.hint { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
::placeholder { color: #6b7280; opacity: 1; }

/* Поля ввода: заметная граница и фокус */
input, select, textarea { border: 1px solid #b8c1cf; color: var(--text); font-size: 15px; }
input:hover, select:hover, textarea:hover { border-color: #8f9bb0; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(31, 63, 143, .35); outline-offset: 1px; border-color: var(--primary);
}
input:disabled, select:disabled, textarea:disabled { background: #f1f3f7; color: #4b5563; }

/* Кнопки */
.btn { border: 1px solid #c3cbd8; color: #1f2937; background: #fff; }
.btn:hover { border-color: #8f9bb0; background: #f6f8fb; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { background: #c62828; border-color: #c62828; color: #fff; }
.btn-danger:hover { background: #a61f1f; border-color: #a61f1f; }
.btn:disabled { opacity: .55; }

/* Меню */
.nav-section { color: #5b6475; font-size: 11.5px; }
.nav a { color: #1f2937; font-size: 14px; line-height: 1.35; }
.nav a .icon { color: #4b5563; }
.nav a:hover { background: #e9edf5; color: #111827; }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.nav a.active .icon { color: var(--primary); }
.sidebar .brand-sub, .sidebar-footer { color: #5b6475; }
.topbar h2 { color: var(--text); }
.topbar-search input { background: #f3f5f9; border: 1px solid #d4dae4; }
.icon-btn { color: #374151; }

/* Таблицы */
th { color: #374151; background: #f1f4f8; font-size: 12px; font-weight: 700; border-bottom: 1px solid #c9d1dd; }
td { border-bottom: 1px solid #e3e8ef; color: var(--text); }
tbody tr:hover td { background: #f5f7fb; }
a, .link { color: var(--primary); }
a.link:hover { text-decoration: underline; }

/* Карточки: чёткая граница на светлом фоне */
.card { box-shadow: 0 1px 2px rgba(17, 24, 39, .06), 0 2px 10px rgba(17, 24, 39, .05); border: 1px solid #e1e6ee; }
.card.stat, .card.stat:nth-child(even) { border: 1px solid #e1e6ee; }

/* Статусы: тёмный текст на светлом фоне (не ниже 4.5:1) */
.pill-green { background: #dcf3e6; color: #11633a; }
.pill-red { background: #fde3e3; color: #a3141c; }
.pill-orange { background: #fdefd3; color: #7a4a00; }
.pill-blue { background: #e1e9fb; color: #1a3a86; }
.pill-gray { background: #e6e9ef; color: #374151; }
.pill-violet { background: #ece4ff; color: #5326c4; }
.status-on { color: #11633a; }
.status-off { color: #a3141c; }
.form-error { color: #a3141c; }

/* Вкладки */
.tabs-line button, .tabs-line a { color: #4b5563; font-weight: 600; }
.tabs-line .active { color: var(--primary); }
.tabs-line .count { color: #374151; background: #e6e9ef; }

.toast { font-size: 14.5px; }

/* Узкие экраны: содержимое не шире экрана */
.content > *, .grid-2 > *, .cab-grid > *, .stats > * { min-width: 0; }
.sec-you .pill { white-space: normal; }
@media (max-width: 900px) {
  .card { max-width: 100%; }
  .segmented { flex-wrap: wrap; }
  .tabs-line { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .tabs-line button, .tabs-line a { white-space: nowrap; }
  .filters { width: 100%; }
  .filters input, .filters select { min-width: 0; flex: 1 1 180px; }
  .filters label.checkbox { white-space: normal; }
  .pill { white-space: normal; }
}
