/* ==========================================================================
   ЯрунетАТС (YarunetATS) — панель администратора
   app.css — оформление: светлая тема, тёмный сайдбар, плотные таблицы.
   Без внешних ресурсов и шрифтов.
   ========================================================================== */

/* ---------- Токены ---------- */
:root {
  --bg: #f2f5f9;
  --bg-soft: #f7f9fc;
  --panel: #ffffff;
  --panel-alt: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #1a2333;
  --text-secondary: #475569;
  --muted: #66768f;
  --muted-2: #94a3b8;

  --accent: #235a9f;
  --accent-hover: #1c4b87;
  --accent-active: #173c6d;
  --accent-soft: #eaf1fa;
  --accent-border: #c3d8f0;

  --sidebar: #131c2b;
  --sidebar-2: #182437;
  --sidebar-line: #24334a;
  --sidebar-text: #9fb0c7;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: #1c2a40;

  --ok: #0f7a52;
  --ok-soft: #e6f5ee;
  --ok-border: #bfe6d5;
  --warn: #96560b;
  --warn-soft: #fdf3e3;
  --warn-border: #f2ddb4;
  --danger: #b02a24;
  --danger-soft: #fceceb;
  --danger-border: #f3c9c6;
  --info: #1f5fa8;
  --info-soft: #e9f1fb;
  --info-border: #c6dcf4;
  --violet: #6545a4;
  --violet-soft: #f1ecfa;
  --violet-border: #ddd0f0;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.22);
  --font: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
  --sidebar-w: 252px;
}

/* ---------- Сброс ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; }
[hidden] { display: none !important; }

.icon { flex: 0 0 auto; width: 18px; height: 18px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--accent);
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.noscript {
  margin: 40px auto;
  max-width: 560px;
  padding: 18px 22px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  color: var(--warn);
}

/* ---------- Каркас ---------- */
#app { min-height: 100vh; }

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Сайдбар ---------- */
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--sidebar);
  color: var(--sidebar-text);
  border-right: 1px solid #0c1420;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 19px 18px 17px;
  border-bottom: 1px solid var(--sidebar-line);
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 9px;
  background: linear-gradient(140deg, #2f6fc4, #1d4f94);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.brand__mark svg { width: 20px; height: 20px; }

.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__name { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.brand__sub {
  margin-top: 1px;
  color: #7d8fa8;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 10px 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-line) transparent;
}
.nav::-webkit-scrollbar { width: 8px; }
.nav::-webkit-scrollbar-thumb { background: #2a3a52; border-radius: 8px; }

.nav__group { margin-top: 12px; }
.nav__group-title {
  padding: 0 10px 6px;
  color: #64778f;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 37px;
  margin: 1px 0;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 450;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav__item:hover { background: var(--sidebar-hover); color: #e8eef8; text-decoration: none; }
.nav__item.is-active {
  background: #243753;
  color: var(--sidebar-text-active);
  font-weight: 550;
}
.nav__item.is-active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #5b93e0;
}
.nav__icon { display: inline-flex; color: #8095b1; }
.nav__item.is-active .nav__icon { color: #9dc0f0; }
.nav__icon svg { width: 18px; height: 18px; }
.nav__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar__footer {
  flex: 0 0 auto;
  padding: 12px;
  border-top: 1px solid var(--sidebar-line);
  background: var(--sidebar-2);
}
.user-card { display: flex; align-items: center; gap: 10px; }
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: linear-gradient(140deg, #3c6ea9, #28496f);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.user-card__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.user-card__name {
  color: #eef3fa;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-card__role { color: #7d8fa8; font-size: 11.5px; }
.sidebar__author {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--sidebar-line);
  color: #64778f;
  font-size: 10.5px;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar__author a { color: #8ea7c6; text-decoration: none; }
.sidebar__author a:hover { color: #d7e5f7; text-decoration: underline; }

/* ---------- Основная область ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 28px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.topbar__menu { display: none; }
.topbar__titles { min-width: 0; flex: 1 1 auto; }
.topbar__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__subtitle {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__right { display: flex; align-items: center; gap: 14px; }
.topbar__date { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.topbar__user { display: none; }

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  color: var(--warn);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.demo-badge svg { width: 13px; height: 13px; }

.page {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1440px;
  padding: 24px 28px 44px;
  outline: none;
}

/* ---------- Заголовок страницы ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head__text { min-width: 0; }
.page-head__title { font-size: 20px; font-weight: 650; letter-spacing: -0.015em; }
.page-head__desc { margin-top: 3px; color: var(--muted); font-size: 12.5px; max-width: 720px; }
.page-head__actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ---------- Карточки ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.card__head--plain { border-bottom: 0; padding-bottom: 4px; }
.card__title { font-size: 14px; font-weight: 600; }
.card__sub { margin-top: 2px; color: var(--muted); font-size: 12px; }
.card__body { padding: 16px 18px; }
.card__body--flush { padding: 0; }
.card__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  background: var(--panel-alt);
  border-radius: 0 0 var(--radius) var(--radius);
  flex-wrap: wrap;
}

/* ---------- Сетки ---------- */
.grid { display: grid; gap: 16px; }
.grid--stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }
.grid--aside { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.spacer { flex: 1 1 auto; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* ---------- Плитки статистики ---------- */
.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stat__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stat__label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.stat__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex: 0 0 32px;
}
.stat__icon svg { width: 17px; height: 17px; }
.stat__value {
  font-size: 27px;
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat__meta { color: var(--muted); font-size: 12px; }
.stat--in .stat__icon { background: var(--info-soft); color: var(--info); }
.stat--out .stat__icon { background: var(--ok-soft); color: var(--ok); }
.stat--miss .stat__icon { background: var(--danger-soft); color: var(--danger); }
.stat--dur .stat__icon { background: var(--violet-soft); color: var(--violet); }
.stat--accent .stat__icon { background: var(--accent-soft); color: var(--accent); }

/* ---------- Плашка новых заявок на дашборде ---------- */
.leads-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.leads-hint:hover { background: #e2ecfa; border-color: #a9c8ec; text-decoration: none; }
.leads-hint__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
}
.leads-hint__icon svg { width: 16px; height: 16px; }
.leads-hint__text { display: flex; align-items: baseline; gap: 8px; }
.leads-hint__label { font-size: 13px; font-weight: 600; }
.leads-hint__value { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.leads-hint__link { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.leads-hint__link svg { width: 14px; height: 14px; }

/* ---------- Заявки ---------- */
.lead-message { display: inline-block; max-width: 300px; vertical-align: bottom; }
.lead-message-full {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 300px;
  overflow: auto;
}
.lead-message-full .muted { color: var(--muted); }

/* ---------- Интеграции (экран «Настройки») ---------- */
.integration-panel { margin-top: 16px; }
.integration-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.integration-head__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}
.integration-head__icon svg { width: 17px; height: 17px; }
.integration-head__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.integration-title { font-size: 14px; font-weight: 600; }
.integration-desc { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.integration-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.integration-result { margin-top: 14px; }
.integration-result:empty { display: none; }
.integration-result .alert { margin: 0; }
#integration-tabs button { display: inline-flex; align-items: center; gap: 6px; }
#integration-tabs button svg { width: 14px; height: 14px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(35, 90, 159, 0.25);
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--primary:active { background: var(--accent-active); }

.btn--secondary {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.btn--secondary:hover { background: var(--panel-alt); border-color: #b6c2d1; }

.btn--ghost { color: var(--muted); }
.btn--ghost:hover { background: #eef2f7; color: var(--text); }

.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: #96221d; border-color: #96221d; }

.btn--danger-ghost { color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-soft); }

.btn--sm { height: 29px; padding: 0 10px; font-size: 12.5px; }
.btn--sm svg { width: 14px; height: 14px; }
.btn--lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: #eef2f7; color: var(--text); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.icon-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn--on-dark { color: #7d8fa8; }
.icon-btn--on-dark:hover { background: #24344c; color: #dbe6f5; }
.icon-btn--bordered { border-color: var(--border); background: #fff; }

.btn-group { display: inline-flex; align-items: center; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn + .btn { margin-left: -1px; }

/* ---------- Поля ввода ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field__label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.field__label .req { color: var(--danger); margin-left: 2px; }
.field__hint { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.field__error { color: var(--danger); font-size: 11.5px; }
.field--inline { flex-direction: row; align-items: center; gap: 8px; }
.field--inline .field__label { margin: 0; }

.input,
.select,
.textarea {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.textarea { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; line-height: 1.4; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:hover, .select:hover, .textarea:hover { border-color: #b3c0d0; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(35, 90, 159, 0.13);
}
.input[disabled], .select[disabled], .textarea[disabled] { background: #f1f5f9; color: var(--muted); cursor: not-allowed; }
.input--invalid, .select--invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(176, 42, 36, 0.1); }
.input--sm, .select--sm { height: 30px; font-size: 12.5px; }

.select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 220px;
}
.search__icon {
  position: absolute;
  left: 10px;
  color: var(--muted-2);
  pointer-events: none;
  display: inline-flex;
}
.search__icon svg { width: 15px; height: 15px; }
.search .input { padding-left: 32px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .field--wide { grid-column: 1 / -1; }
.form-section {
  padding-top: 4px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}
.form-section:not(:first-child) { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.form-actions--start { justify-content: flex-start; }

/* ---------- Переключатель ---------- */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  position: relative;
  width: 34px;
  height: 19px;
  flex: 0 0 34px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.15s ease;
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
  transition: transform 0.15s ease;
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(15px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: 0.5; cursor: not-allowed; }
.switch__label { font-size: 13px; color: var(--text-secondary); }
.switch--sm .switch__track { width: 30px; height: 17px; flex-basis: 30px; }
.switch--sm .switch__track::after { width: 13px; height: 13px; }
.switch--sm input:checked + .switch__track::after { transform: translateX(13px); }

/* ---------- Чекбоксы дней недели ---------- */
.weekdays { display: flex; flex-wrap: wrap; gap: 6px; }
.weekday { position: relative; display: inline-flex; }
.weekday input { position: absolute; opacity: 0; width: 0; height: 0; }
.weekday span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.weekday input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.weekday input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Бейджи ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge--neutral { background: #eef2f6; border-color: #e2e8f0; color: #526179; }
.badge svg { width: 13px; height: 13px; }
.badge--ok { background: var(--ok-soft); border-color: var(--ok-border); color: var(--ok); }
.badge--in { background: var(--info-soft); border-color: var(--info-border); color: var(--info); }
.badge--out { background: var(--ok-soft); border-color: var(--ok-border); color: var(--ok); }
.badge--internal { background: #eef2f6; border-color: #e2e8f0; color: #526179; }
.badge--miss,
.badge--err { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.badge--warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn); }
.badge--vm { background: var(--violet-soft); border-color: var(--violet-border); color: var(--violet); }
.badge--admin { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.badge--manager { background: var(--violet-soft); border-color: var(--violet-border); color: var(--violet); }
.badge--employee { background: #eef2f6; border-color: #e2e8f0; color: #526179; }
.badge--role-admin { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.badge--role-manager { background: var(--violet-soft); border-color: var(--violet-border); color: var(--violet); }
.badge--role-employee { background: #eef2f6; border-color: #e2e8f0; color: #526179; }
.badge--dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ---------- Таблицы ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table-wrap--scroll { max-height: 560px; overflow-y: auto; }

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 14px;
  background: #f7f9fc;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table th.is-sortable { cursor: pointer; user-select: none; }
.data-table th.is-sortable:hover { color: var(--text-secondary); }
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fafd; }
.data-table tbody tr.is-clickable { cursor: pointer; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .centre { text-align: center; }
.data-table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.data-table .col-tight { width: 1%; white-space: nowrap; }
.data-table .muted { color: var(--muted); }
.data-table .mono { font-family: var(--mono); font-size: 12.5px; }

.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-user__text { display: flex; flex-direction: column; min-width: 0; }
.cell-user__name { font-weight: 550; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-user__sub { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-sub { display: block; margin-top: 1px; color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.avatar--sm { width: 28px; height: 28px; flex-basis: 28px; font-size: 11px; }

.row-actions { display: inline-flex; align-items: center; gap: 2px; justify-content: flex-end; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* ---------- Панель фильтров ---------- */
.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-alt);
}
.toolbar .field { min-width: 0; }
.toolbar .field--grow { flex: 1 1 220px; }
.toolbar .field--search { flex: 1 1 240px; }
.toolbar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ---------- График по часам ---------- */
.chart { display: flex; align-items: flex-end; gap: 16px; height: 190px; margin-top: 4px; }
.chart > div:not(.chart__axis) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}
.chart__bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
}
.chart__col {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  flex: 1 1 0;
  height: 100%;
  min-width: 0;
  border-radius: 3px 3px 0 0;
}
.chart__bar {
  width: 100%;
  max-width: 26px;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #5b8cc9, #2c5f9e);
  transition: filter 0.12s ease;
}
.chart__col:hover .chart__bar { filter: brightness(1.12); }
.chart__col.is-peak .chart__bar { background: linear-gradient(180deg, #2c5f9e, #173c6d); }
.chart__col::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% - 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 4px 8px;
  border-radius: 5px;
  background: #1e293b;
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 3;
}
.chart__col:hover::after { opacity: 1; transform: translateX(-50%) translateY(-8px); }
.chart__labels {
  display: flex;
  gap: 4px;
  margin-top: 7px;
}
.chart__label {
  flex: 1 1 0;
  text-align: center;
  color: var(--muted-2);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  overflow: hidden;
}
.chart__axis { display: flex; flex-direction: column; justify-content: space-between; height: 100%; color: var(--muted-2); font-size: 10.5px; text-align: right; padding-bottom: 1px; font-variant-numeric: tabular-nums; }
.chart__meta { display: flex; align-items: center; gap: 16px; margin-top: 12px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }

/* ---------- Кольцевой индикатор (CSS) ---------- */
.ring {
  --p: 0;
  position: relative;
  width: 128px;
  height: 128px;
  flex: 0 0 128px;
  border-radius: 50%;
  background: conic-gradient(var(--ok) calc(var(--p) * 1%), #e8edf3 0);
  display: grid;
  place-items: center;
}
.ring::before {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: var(--panel);
}
.ring__text { position: relative; z-index: 1; text-align: center; }
.ring__value { font-size: 25px; font-weight: 650; letter-spacing: -0.02em; }
.ring__label { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Разделение «список — деталь» ---------- */
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.split__list { display: flex; flex-direction: column; gap: 6px; }
.split__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.split__item:hover { border-color: var(--border-strong); background: var(--panel-alt); }
.split__item.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(35, 90, 159, 0.1); background: #fbfdff; }
.split__item-text { display: flex; flex-direction: column; min-width: 0; }
.split__item-title { font-size: 13px; font-weight: 600; color: var(--text); }
.split__item-sub { color: var(--muted); font-size: 11.5px; }
.split__item-meta { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.split__body { min-width: 0; }

.member-list { display: flex; flex-direction: column; }
.member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid #eef2f7;
}
.member:last-child { border-bottom: 0; }
.member__order {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.member__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.member__name { font-weight: 550; }
.member__sub { color: var(--muted); font-size: 11.5px; }
.member__actions { display: flex; align-items: center; gap: 1px; }

/* ---------- IVR-клавиши ---------- */
.ivr-key {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f7;
}
.ivr-key:last-child { border-bottom: 0; }
.ivr-key__digit {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--panel-alt);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 650;
  color: var(--accent);
}
.ivr-key__body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ivr-key__target { display: flex; flex-direction: column; gap: 2px; }
.ivr-key__label { font-weight: 550; }
.ivr-key__meta { color: var(--muted); font-size: 11.5px; }

/* ---------- Уведомления / подсказки ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  font-size: 12.5px;
  color: var(--text-secondary);
}
.alert svg { width: 16px; height: 16px; margin-top: 1px; flex: 0 0 16px; }
.alert__body { min-width: 0; }
.alert__title { font-weight: 600; color: var(--text); margin-bottom: 1px; }
.alert--info { background: var(--info-soft); border-color: var(--info-border); color: #1c4b7d; }
.alert--info svg { color: var(--info); }
.alert--warn { background: var(--warn-soft); border-color: var(--warn-border); color: #7b4a0c; }
.alert--warn svg { color: var(--warn); }
.alert--danger { background: var(--danger-soft); border-color: var(--danger-border); color: #8f221d; }
.alert--danger svg { color: var(--danger); }
.alert--success { background: var(--ok-soft); border-color: var(--ok-border); color: #0c6242; }
.alert--success svg { color: var(--ok); }

/* ---------- Пустые состояния и загрузка ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 46px 20px;
  text-align: center;
}
.empty__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 2px;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--muted-2);
}
.empty__icon svg { width: 21px; height: 21px; }
.empty__title { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.empty__text { max-width: 460px; color: var(--muted); font-size: 12.5px; }
.empty__action { margin-top: 8px; }

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 13px;
}
.spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid #d6dee8;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  display: block;
  border-radius: 4px;
  background: linear-gradient(90deg, #eef2f7 25%, #e3e9f0 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
.skeleton--text { height: 11px; width: 100%; }
.skeleton--title { height: 18px; width: 55%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Пагинация ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 18px;
  border-top: 1px solid var(--border);
  background: var(--panel-alt);
  border-radius: 0 0 var(--radius) var(--radius);
  flex-wrap: wrap;
}
.pagination__info { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pagination__controls { display: flex; align-items: center; gap: 6px; }
.pagination__page { color: var(--text-secondary); font-size: 12.5px; padding: 0 4px; font-variant-numeric: tabular-nums; }

/* ---------- Модальные окна ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 20px 20px;
  background: rgba(15, 23, 42, 0.48);
  overflow-y: auto;
  animation: fadeIn 0.14s ease;
}
.modal-overlay.is-closing { animation: fadeOut 0.14s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.modal {
  width: 100%;
  max-width: 560px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.16s ease;
}
.modal--sm { max-width: 430px; }
.modal--lg { max-width: 760px; }
.modal--xl { max-width: 960px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-8px) scale(0.99); } to { opacity: 1; transform: none; } }

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal__heading { min-width: 0; }
.modal__title { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.modal__subtitle { margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.modal__body { padding: 18px 20px; }
.modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  background: var(--panel-alt);
  border-radius: 0 0 12px 12px;
  flex-wrap: wrap;
}

.confirm { display: flex; align-items: flex-start; gap: 14px; }
.confirm__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  background: var(--info-soft);
  color: var(--info);
}
.confirm__icon--danger { background: var(--danger-soft); color: var(--danger); }
.confirm__icon svg { width: 20px; height: 20px; }
.confirm__text { color: var(--text-secondary); font-size: 13.5px; line-height: 1.5; padding-top: 2px; }

/* ---------- Тосты ---------- */
.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 360px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toastIn 0.18s ease;
}
.toast.is-leaving { animation: toastOut 0.18s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(14px); } }
.toast__icon { display: inline-flex; margin-top: 1px; }
.toast__icon svg { width: 17px; height: 17px; }
.toast__body { flex: 1 1 auto; min-width: 0; }
.toast__title { font-size: 12.5px; font-weight: 650; }
.toast__text { color: var(--text-secondary); font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.toast__close {
  display: inline-flex;
  padding: 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-2);
}
.toast__close:hover { background: #eef2f7; color: var(--text); }
.toast__close svg { width: 14px; height: 14px; }
.toast--success { border-left: 3px solid var(--ok); }
.toast--success .toast__icon { color: var(--ok); }
.toast--error { border-left: 3px solid var(--danger); }
.toast--error .toast__icon { color: var(--danger); }
.toast--warning { border-left: 3px solid var(--warn); }
.toast--warning .toast__icon { color: var(--warn); }
.toast--info { border-left: 3px solid var(--info); }
.toast--info .toast__icon { color: var(--info); }

/* ---------- Авторизация ---------- */
.auth {
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(440px, 0.92fr);
  min-height: 100vh;
  background: #0f1824;
}
.auth__aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 52px;
  background:
    radial-gradient(1000px 520px at -10% -10%, rgba(56, 108, 180, 0.32), transparent 60%),
    radial-gradient(760px 420px at 110% 110%, rgba(38, 77, 130, 0.26), transparent 58%),
    linear-gradient(155deg, #101a29 0%, #0c141f 100%);
  color: #d7e2f0;
  overflow: hidden;
}
.auth__brand { display: flex; align-items: center; gap: 12px; }
.auth__brand .brand__mark { width: 42px; height: 42px; flex-basis: 42px; }
.auth__brand-name { color: #fff; font-size: 16px; font-weight: 600; }
.auth__brand-sub { color: #8095b1; font-size: 12px; }
.auth__hero { max-width: 480px; margin: 36px 0 26px; }
.auth__hero-title { color: #fff; font-size: 30px; line-height: 1.22; font-weight: 650; letter-spacing: -0.025em; }
.auth__hero-text { margin-top: 14px; color: #a4b5cb; font-size: 14px; line-height: 1.6; }
.auth__features { display: flex; flex-direction: column; gap: 13px; margin-top: 30px; }
.auth__feature { display: flex; align-items: flex-start; gap: 11px; color: #c0cddd; font-size: 13.5px; }
.auth__feature-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid #2c405c;
  border-radius: 8px;
  background: #162334;
  color: #7fa8dd;
}
.auth__feature-icon svg { width: 15px; height: 15px; }
.auth__feature-text { padding-top: 4px; }
.auth__footer { color: #667992; font-size: 11.5px; }

.auth__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  background: #eef2f8;
}
.auth__card { width: 100%; max-width: 386px; }
.auth__title { font-size: 23px; font-weight: 650; letter-spacing: -0.02em; }
.auth__subtitle { margin-top: 6px; color: var(--muted); font-size: 13px; }
.auth__form { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.auth__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.auth__error { margin-top: 4px; }
.auth__submit { margin-top: 4px; }
.auth__demo {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.auth__demo-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}
.auth__demo-list { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.auth__demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--mono);
}
.auth__demo-btn:hover { border-color: var(--accent); color: var(--accent); }
.auth__demo-btn svg { width: 13px; height: 13px; }
.auth__hint { margin-top: 18px; color: var(--muted-2); font-size: 11.5px; line-height: 1.5; }
.auth__author {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.5;
}
.auth__author a { color: var(--muted); text-decoration: none; }
.auth__author a:hover { color: var(--accent); text-decoration: underline; }
.auth__footer a { color: #8ea7c6; text-decoration: none; }
.auth__footer a:hover { color: #d7e5f7; text-decoration: underline; }
.auth__mock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px 9px;
  border: 1px solid var(--warn-border);
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11.5px;
  font-weight: 600;
}
.auth__mock svg { width: 13px; height: 13px; }

/* ---------- Экран «Конфиги Asterisk» ---------- */
.config-layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 16px; align-items: start; }
.config-list { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.config-file {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: left;
}
.config-file:hover { background: var(--panel-alt); }
.config-file.is-active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); font-weight: 600; }
.config-file svg { width: 14px; height: 14px; opacity: 0.75; }
.config-view { min-width: 0; }
.code {
  margin: 0;
  padding: 16px 18px;
  max-height: 640px;
  overflow: auto;
  background: #101a28;
  color: #cfdcec;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  tab-size: 4;
  white-space: pre;
  border-radius: 0 0 var(--radius) var(--radius);
  scrollbar-width: thin;
  scrollbar-color: #2c405c #101a28;
}
.code::-webkit-scrollbar { width: 10px; height: 10px; }
.code::-webkit-scrollbar-thumb { background: #2c405c; border-radius: 6px; }
.code__comment { color: #7d93ae; }
.code__section { color: #8fb6e8; }
.code__value { color: #c6e3c0; }

.code-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid #1d2b3f;
  background: #162334;
  color: #9fb0c7;
  border-radius: var(--radius) var(--radius) 0 0;
}
.code-toolbar__name { font-family: var(--mono); font-size: 13px; color: #e3ecf6; font-weight: 600; }
.code-toolbar__meta { font-size: 11.5px; color: #7d93ae; }
.code-toolbar__actions { margin-left: auto; display: flex; gap: 6px; }
.code-toolbar .btn--secondary { background: #1e2e44; border-color: #2c405c; color: #c8d6e8; }
.code-toolbar .btn--secondary:hover { background: #263952; border-color: #3a5274; }

/* ---------- Детали звонка ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.detail-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid #eef2f7; }
.detail-row__label { color: var(--muted); font-size: 12px; }
.detail-row__value { color: var(--text); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.detail-row--wide { grid-column: 1 / -1; }
.call-player {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px 14px;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
}
.call-player audio { width: 100%; height: 36px; }
.call-player__meta { color: var(--muted); font-size: 11.5px; }

/* ---------- Карточка SIP-устройства ---------- */
.sip-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
}
.sip-card__title { font-weight: 650; margin-bottom: 12px; }
.sip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.sip-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
.sip-field__label { color: var(--muted); font-size: 11.5px; }
.sip-field__value { font-family: var(--mono); font-size: 12.5px; font-weight: 600; word-break: break-all; text-align: right; }
.sip-field__copy { color: var(--muted-2); border: 0; background: transparent; padding: 2px; display: inline-flex; }
.sip-field__copy:hover { color: var(--accent); }
.sip-field__copy svg { width: 14px; height: 14px; }
.sip-hint { margin-top: 12px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }

/* ---------- Тест транка ---------- */
.test-result { display: flex; align-items: flex-start; gap: 10px; }
.test-result__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
}
.test-result__icon svg { width: 17px; height: 17px; }
.test-result--ok .test-result__icon { background: var(--ok-soft); color: var(--ok); }
.test-result--error .test-result__icon { background: var(--danger-soft); color: var(--danger); }
.test-result--pending .test-result__icon { background: var(--info-soft); color: var(--info); }
.test-result__text { display: flex; flex-direction: column; gap: 2px; }
.test-result__title { font-weight: 600; font-size: 13px; }
.test-result__msg { color: var(--muted); font-size: 12px; }

/* ---------- Переключатель периода (segmented) ---------- */
.segmented {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  gap: 2px;
}
.segmented button {
  border: 0;
  border-radius: 6px;
  padding: 5px 11px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
}
.segmented button:hover { color: var(--text); background: var(--panel-alt); }
.segmented button.is-active { background: var(--accent-soft); color: var(--accent); }

/* ---------- Служебные ---------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-accent { color: var(--accent); }
.center { text-align: center; }
.divider { height: 1px; margin: 16px 0; background: var(--border); border: 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.dot-sep { color: var(--muted-2); margin: 0 6px; }
.list-reset { list-style: none; }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Пометка демонстрационного режима (dev-stub.html) ---------- */
.dev-stub-note {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 30;
  max-width: 340px;
  padding: 7px 10px;
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11px;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}
.dev-stub-note a { color: var(--warn); text-decoration: underline; white-space: nowrap; }

/* ---------- Адаптив ---------- */
@media (max-width: 1439px) {
  .page { padding: 22px 24px 40px; }
  .topbar { padding: 10px 24px; }
}

@media (max-width: 1279px) {
  :root { --sidebar-w: 224px; }
  .grid--main { grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); }
  .auth__aside { padding: 36px 38px; }
  .auth__hero-title { font-size: 26px; }
  .auth__panel { padding: 32px; }
  .split { grid-template-columns: 270px minmax(0, 1fr); }
  .config-layout { grid-template-columns: 240px minmax(0, 1fr); }
}

@media (max-width: 1099px) {
  :root { --sidebar-w: 68px; }
  .brand { justify-content: center; padding: 16px 8px; }
  .brand__text { display: none; }
  .nav { padding: 6px 8px 14px; }
  .nav__group-title { display: none; }
  .nav__item { justify-content: center; padding: 0; height: 40px; }
  .nav__label { display: none; }
  .nav__item.is-active::before { left: -8px; }
  .sidebar__footer { padding: 10px 8px; }
  .user-card { justify-content: center; }
  .user-card__text { display: none; }
  .user-card #logout-btn { display: none; }
  .sidebar__author { display: none; }
  .topbar__user { display: flex; align-items: center; gap: 8px; }
  .grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--main, .grid--aside { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .config-layout { grid-template-columns: minmax(0, 1fr); }
  .config-list { flex-direction: row; flex-wrap: wrap; }
  .config-file { width: auto; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__aside { display: none; }
  .auth__panel { padding: 28px 20px; }
}

@media (max-width: 720px) {
  .topbar { padding: 9px 14px; gap: 10px; }
  .topbar__menu { display: inline-flex; }
  .sidebar { display: none; position: fixed; z-index: 40; width: 252px; }
  .shell.is-menu-open .sidebar { display: flex; }
  .page { padding: 16px 14px 32px; }
  .topbar__date, .demo-badge { display: none; }
  .grid--stats, .grid--2, .grid--3, .form-grid, .form-grid--3, .sip-grid, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .modal-overlay { padding: 20px 12px; }
  .toolbar__actions { margin-left: 0; }
  .toast-host { right: 12px; left: 12px; bottom: 12px; width: auto; }
  .topbar__title { font-size: 16px; }
  .page-head__title { font-size: 18px; }
}
