/* ---------- Шрифт Inter (локально, woff2) ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-cyrillic-400.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-cyrillic-500.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-cyrillic-600.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-cyrillic-700.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-cyrillic-ext-400.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-cyrillic-ext-500.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-cyrillic-ext-600.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-cyrillic-ext-700.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-latin-400.woff2') format('woff2');
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-latin-500.woff2') format('woff2');
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-latin-600.woff2') format('woff2');
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-latin-700.woff2') format('woff2');
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --header: #0b2a4a;
  --text: #303133;
  --text-secondary: #606266;
  --text-muted: #909399;
  --border: #e5e6eb;
  --bg: #eef2f9;
  --sidebar-width: 220px;
  --danger: #f56c6c;
  --radius: 4px;
}

* { box-sizing: border-box; }

html, body, .app { height: 100%; margin: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

/* ---------- Каркас ---------- */
.app { display: flex; flex-direction: column; height: 100%; }
.app-body { display: flex; flex: 1; min-height: 0; }

/* ---------- Верхняя панель ---------- */
.topbar {
  height: 64px;
  background: var(--header);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  flex-shrink: 0;
}
.topbar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
/* Логотип Valinor в шапке (белая версия знака) */
.topbar .logo-valinor {
  display: block;
  height: 32px;
  width: auto;
}
.topbar .user-chip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.topbar .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f5b91e;
  color: #0b2a4a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* ---------- Боковое меню ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 8px 0 24px;
  flex-shrink: 0;
}
.sidebar .section { margin-top: 8px; }
.sidebar .section-title {
  padding: 10px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sidebar .item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: #111418;
  cursor: pointer;
  font-size: 13.5px;
  user-select: none;
}
.sidebar .item.bold { font-weight: 600; }
.sidebar .item svg { flex-shrink: 0; opacity: 0.85; }
.sidebar .item:hover { background: #f5f6f7; }
.sidebar .item.active {
  background: #e6eefe;
  color: var(--primary-dark);
  font-weight: 600;
}
.sidebar .item .soon {
  margin-left: auto;
  font-size: 10px;
  background: #f0f1f3;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 1px 6px;
}

/* ---------- Контент ---------- */
.content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 16px 20px 32px;
}
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 14px;
}
.page-header h1 { font-size: 17px; font-weight: 600; margin: 0; }
.page-header .spacer { flex: 1; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- Панель инструментов таблицы ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.toolbar .spacer { flex: 1; }
.toolbar .search-input {
  position: relative;
  display: flex;
  align-items: center;
}
.toolbar .search-input input {
  padding-left: 30px;
  width: 240px;
}
.toolbar .search-input svg {
  position: absolute;
  left: 9px;
  color: var(--text-muted);
}

/* ---------- Кнопки / поля ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: #c9cdd4; background: #fafafa; }
.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 { color: var(--danger); border-color: #fbc4c4; }
.btn.danger:hover { background: #fef0f0; }
.btn.icon { padding: 0 8px; }
.btn:disabled { opacity: 0.55; cursor: default; }

input[type='text'], input[type='email'], input[type='password'],
input[type='number'], input[type='datetime-local'], select, textarea {
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  background: #fff;
  width: 100%;
}
textarea { height: auto; padding: 8px 10px; font-family: inherit; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.field label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.checkbox-row input { width: 15px; height: 15px; accent-color: var(--primary); }
.checkbox-row label { margin: 0; }

/* Список с чекбоксами (выбор пользователей, групп, ресурсов, УЗ, протоколов) */
.check-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 150px;
  overflow-y: auto;
  padding: 4px 10px;
  background: #fff;
}
.check-list .checkbox-row { padding: 5px 2px; }
.radio-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.radio-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: pointer;
}
.radio-row input { width: 15px; height: 15px; accent-color: var(--primary); }

/* Поисковый выбор (пользователи, группы, ресурсы, УЗ) с чипами */
.picker-search { width: 100%; margin-bottom: 6px; }
.picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.picker-chips:empty { display: none; }
.picker-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eaf1fd;
  color: var(--primary);
  border: 1px solid #c8dbfa;
  border-radius: 14px;
  padding: 3px 6px 3px 10px;
  font-size: 12.5px;
  max-width: 100%;
}
.picker-chip .chip-x {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.picker-chip .chip-x:hover { color: var(--danger); }

/* ---------- Таблица ---------- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #fafbfc;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f1f3;
  font-size: 13.5px;
  vertical-align: middle;
}
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #f7f9fa; }
.data-table .empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0;
  cursor: default;
}
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.link { color: var(--primary-dark); font-weight: 500; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ---------- Бейджи ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  border-radius: 10px;
  padding: 2px 10px;
  white-space: nowrap;
}
.badge.green { background: #e6eefe; color: var(--primary-dark); }
.badge.gray { background: #f0f1f3; color: var(--text-muted); }
.badge.red { background: #fef0f0; color: var(--danger); }
.badge.orange { background: #fdf3e7; color: #e6a23c; }
.badge.yellow { background: #fdf6e0; color: #b8860b; }
.badge.blue { background: #e8f0fe; color: var(--accent); }

/* ---------- Модальное окно ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal {
  background: #fff;
  border-radius: 6px;
  width: 640px;
  max-width: 100%;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.modal.wide { width: 860px; }
.modal-header {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 15.5px; margin: 0; font-weight: 600; }
.modal-header .close {
  margin-left: auto;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
}
.modal-header .close:hover { color: var(--text); }
.modal-body { padding: 18px 20px; max-height: 68vh; overflow-y: auto; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}
.form-section {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin: 16px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}
.form-section:first-child { margin-top: 0; }

/* ---------- Детали ---------- */
.details-grid {
  display: grid;
  grid-template-columns: 190px 1fr;
  row-gap: 8px;
  column-gap: 16px;
  font-size: 13.5px;
  margin: 0;
}
.details-grid dt { color: var(--text-muted); }
.details-grid dd { margin: 0; word-break: break-word; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs .tab {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs .tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: #f0f1f3;
  border-radius: 10px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--text-secondary);
}
.chip.green { background: #e6eefe; color: var(--primary-dark); }

pre.json {
  background: #f7f8fa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 12px;
  overflow-x: auto;
  max-height: 320px;
  overflow-y: auto;
}

/* ---------- Дашборд ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.stat-card .icon-box {
  width: 44px; height: 44px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: #e6eefe; color: var(--primary-dark); flex-shrink: 0;
}
.stat-card .value { font-size: 22px; font-weight: 700; }
.stat-card .label { font-size: 12.5px; color: var(--text-muted); }
.card-block { padding: 16px 18px; margin-bottom: 16px; }
.card-block h3 { margin: 0 0 12px; font-size: 14.5px; }
.endpoint-list { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; width: 100%; border-collapse: collapse; }
.endpoint-list td { padding: 6px 8px; border-bottom: 1px solid #f0f1f3; }
.endpoint-list .method { font-weight: 700; width: 70px; }
.endpoint-list .method.get { color: #409eff; }
.endpoint-list .method.post { color: var(--primary-dark); }
.endpoint-list .method.patch { color: #b8860b; }
.endpoint-list .method.delete { color: var(--danger); }

/* ---------- Уведомления ---------- */
.toasts { position: fixed; top: 60px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 280px; max-width: 420px;
  background: #fff; border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  padding: 12px 16px; font-size: 13.5px;
  border-left: 4px solid var(--primary);
  animation: toast-in 0.18s ease-out;
}
.toast.error { border-left-color: var(--danger); }
.toast .title { font-weight: 600; margin-bottom: 2px; }
.toast .msg { color: var(--text-secondary); word-break: break-word; }
@keyframes toast-in { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Прочее ---------- */
.loading { padding: 40px; text-align: center; color: var(--text-muted); }
.placeholder-page { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.placeholder-page svg { opacity: 0.4; margin-bottom: 12px; }
.placeholder-page h2 { color: var(--text-secondary); font-size: 16px; margin: 0 0 8px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.muted { color: var(--text-muted); }

/* Чипы с кнопкой удаления и строки выбора */
.chip { display: inline-flex; align-items: center; }
.chip-x {
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.55;
  font-size: 11px;
  padding: 0 0 0 5px;
  line-height: 1;
}
.chip-x:hover { opacity: 1; }
.chip-x:disabled { opacity: 0.3; cursor: default; }
.picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 4px;
  border-bottom: 1px solid #f0f1f3;
}
.picker-row:last-child { border-bottom: none; }

/* Выбор протоколов подключения (создание/редактирование ресурса) */
.proto-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid #f0f1f3;
}
.proto-row:last-child { border-bottom: none; }
.proto-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); }
.proto-row .proto-name { min-width: 90px; font-weight: 500; }
.proto-row .muted { font-size: 12.5px; }
.proto-port {
  width: 76px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
.proto-port:disabled { background: #f4f5f7; color: var(--text-muted); }

/* Радио-группа (тип секрета УЗ) */
.radio-row { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 4px; }
.radio-item { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; cursor: pointer; }
.radio-item input { accent-color: var(--primary); }

/* Диагностика ресурса: ping / SSH / отпечаток */
.diag-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.alert-box {
  background: #fdecea;
  border: 1px solid #f5b7b1;
  color: #922;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13.5px;
}
tr.row-alert { background: #fdecea; }
tr.row-alert:hover { background: #fbdcd8; }
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 7px;
}
.dot.online { background: #2e9e5b; }
.dot.offline { background: #c0392b; }

/* ---------- Авторизация ---------- */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dfe6ee url('login-bg.jpg') center / cover no-repeat;
  padding: 24px;
}
.login-shell {
  display: flex;
  align-items: center;
  gap: 110px;
}
/* Левая фирменная часть — текст прямо на фоне, без подложки */
.login-brand { width: 460px; }
.login-brand h2 {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 18px;
  color: #0b2a4a;
}
.login-brand p { font-size: 15px; line-height: 1.7; color: #4a5a6e; }
.login-brand-chips { margin-top: 34px; display: flex; flex-direction: column; gap: 15px; }
.login-brand-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 15px;
  color: #33465e;
}
.login-brand-chip svg { flex: none; color: #f5b91e; }
/* Карточка формы */
.login-form-side {
  width: 675px;
  max-width: 100%;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(11, 42, 74, 0.16);
}
.login-form-head {
  display: flex;
  justify-content: flex-start;
  padding: 26px 48px 20px;
  border-bottom: 1px solid #e4eaf1;
  background: #fff;
}
.login-logo-img { height: 46px; display: block; }
.login-form-inner { padding: 36px 48px 34px; width: 100%; }
.login-form-inner h1 { font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.login-form-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 26px; }
.login-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #344054;
  margin-bottom: 8px;
}
.login-label svg { color: #5b6b80; }
.login-notice {
  background: #fdf3e7;
  border: 1px solid #f3d9b0;
  color: #8a5a00;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.login-error {
  color: var(--danger);
  font-size: 12.5px;
  min-height: 18px;
  margin-bottom: 6px;
}
.login-form-side .field > input { height: 54px; }
.login-input { position: relative; }
.login-input > svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #98a2b3;
  pointer-events: none;
}
.login-input input {
  width: 100%;
  height: 54px;
  padding: 0 15px 0 46px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  font-size: 15.5px;
  color: var(--text);
  background: #f9fafb;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-input input:focus {
  border-color: #0b2a4a;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(11,42,74,.08);
}
.login-form-inner .login-submit {
  width: 100%;
  height: 56px;
  justify-content: center;
  font-size: 16.5px;
  font-weight: 600;
  margin-top: 12px;
  border: none;
  border-radius: 12px;
  background: #0b2a4a;
  color: #fff;
}
.login-form-inner .login-submit:hover { background: #123f6b; }
.login-form-inner .login-submit svg { margin-right: 8px; }
/* Кнопка-«глазок» в поле пароля */
.login-input.has-eye input { padding-right: 48px; }
.login-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #98a2b3;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.login-eye:hover { color: #344054; background: #f2f4f7; }
/* Альтернативные способы входа */
.login-alt { margin-top: 22px; }
.login-alt-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: #98a2b3;
  margin-bottom: 14px;
}
.login-alt-title span { flex: 1; height: 1px; background: #e4eaf1; }
.login-alt-row { display: flex; gap: 12px; }
.login-alt-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #344054;
  cursor: not-allowed;
  opacity: .75;
}
/* Подвал карточки и бейдж защищённого соединения */
.login-secure {
  position: fixed;
  right: 28px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #5b6b80;
}
.login-secure svg { color: #5b6b80; }
.login-secure-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2fbf71;
}
.login-back {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}
.login-form-foot {
  margin-top: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: #98a2b3;
  text-align: left;
  line-height: 1.6;
}
.login-form-foot svg { flex: none; margin-top: 2px; color: #8fa0b3; }
.login-mfa-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 12px;
}
.login-mfa-text b { color: var(--text); }
.login-qr {
  display: flex;
  justify-content: center;
  margin: 6px 0 12px;
}
.login-qr img {
  width: 200px;
  height: 200px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
}
.login-page-foot {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12.5px;
  color: #8fa0b3;
}
@media (max-width: 1100px) {
  .login-brand { display: none; }
  .login-shell { gap: 0; }
}
@media (max-width: 640px) {
  .login-form-head { padding: 24px; }
  .login-form-inner { padding: 32px 24px 26px; }
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: var(--radius);
  padding: 5px 11px;
  font-size: 12.5px;
  cursor: pointer;
  margin-left: 6px;
}
.logout-btn:hover { background: rgba(255, 255, 255, 0.26); }

/* ---------- Разграничение по ролям ----------
   Элементы с классом admin-only видны только администратору
   (суперпользователь или роль «Администраторы»). */
body:not(.role-admin) .admin-only { display: none !important; }
/* Ping доступен администратору и оператору; для read-only ролей скрыт. */
body.role-readonly #rd-ping { display: none !important; }
body:not(.role-admin) .chip-x { display: none !important; }

/* Сетка «поле-значение» в карточке просмотра (правило доступа и др.) */
.detail-grid {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 8px 16px;
  margin-bottom: 8px;
}

/* Текстовый лог SSH-сессии в карточке просмотра */
.session-log {
  background: #0d1b2a;
  color: #d7e3f4;
  padding: 12px 14px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.45;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0 0 12px;
}

/* Таймлайн активности ресурса (вкладка «Активности») */
.timeline {
  position: relative;
  padding: 4px 0 8px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #d7dee9;
  border-radius: 1px;
}
.timeline-title {
  font-weight: 600;
  font-size: 13.5px;
  margin: 0 0 14px 28px;
  color: #1a2733;
}
.tl-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 9px 0 9px 0;
}
.tl-dot {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  border: 3px solid #c3ccd9;
  background: #fff;
  box-sizing: border-box;
}
.tl-dot.green { border-color: #2fbf71; background: #2fbf71; }
.tl-dot.red { border-color: #e05555; background: #e05555; }
.tl-dot.gray { border-color: #c3ccd9; background: #c3ccd9; }
.tl-item.now .tl-text { font-weight: 600; }
.tl-body { min-width: 0; }
.tl-text {
  font-size: 13.5px;
  line-height: 1.4;
  color: #1a2733;
  word-break: break-word;
}
.tl-time {
  font-size: 12.5px;
  color: #7a8797;
  margin-top: 2px;
}
