/* settings.css v0.3.0 — 02.09.2026 — окно 1400×900, каждый раздел прокручивается сам, раздел «Инструменты» карточками, навигация с акцентной полосой */
/* v0.2.1 — 30.08.2026 — окно 1180×760, навигация 190px, список пользователей выше */
/* v0.2.0 — 30.08.2026 — класс login → who в списках пользователей и телеметрии */
.sidebar-foot-buttons { display: flex; align-items: center; gap: 6px; }
/* ---------- окно ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .42); backdrop-filter: blur(6px); }
.modal-card {
  position: relative;
  width: min(1400px, 100%);
  height: min(900px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 40px 100px -30px rgba(15, 23, 42, .5);
  display: grid;
  grid-template-columns: 220px 1fr;
  overflow: hidden;
}
.modal-nav {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.modal-nav-title {
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-3); padding: 4px 12px 14px;
}
.modal-nav button {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  padding: 11px 14px;
  border-radius: var(--radius-s);
  font-weight: 600; font-size: 14px;
  box-shadow: inset 3px 0 0 transparent;
}
.modal-nav button:hover { background: var(--surface); color: var(--text); }
.modal-nav button.active { background: var(--accent-soft); color: var(--accent); border-color: #bae6fd; box-shadow: inset 3px 0 0 var(--accent); }
.modal-body { position: relative; overflow: hidden; padding: 26px 32px 24px; display: flex; flex-direction: column; }
.modal-close { position: absolute; top: 16px; right: 16px; font-size: 20px; line-height: 1; z-index: 2; }
/* каждый раздел прокручивается сам; содержимое не сжимается */
.section { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; padding-right: 8px; scrollbar-gutter: stable; }
.section > * { flex: 0 0 auto; }
.section h2 { margin: 0 0 16px; font-size: 22px; letter-spacing: -.01em; }
.section h3 { margin: 22px 0 10px; font-size: 14px; color: var(--text-2); }
/* профиль — две колонки */
.section[data-section="profile"] { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto 1fr; column-gap: 36px; align-content: start; }
.section[data-section="profile"] h2 { grid-column: 1 / -1; }
.section[data-section="profile"] #profileForm { grid-column: 1; grid-row: 2 / span 2; }
.section[data-section="profile"] h3 { grid-column: 2; grid-row: 2; margin: 0 0 10px; font-size: 15px; }
.section[data-section="profile"] #passwordForm { grid-column: 2; grid-row: 3; }
/* ---------- формы ---------- */
.form { display: flex; flex-direction: column; gap: 9px; max-width: 400px; }
.form-grid { max-width: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px 14px; }
.form-grid .form-row { grid-column: 1 / -1; }
.form-row { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.modal .field { gap: 4px; }
.modal .field input, .modal .field select {
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  padding: 8px 11px; background: var(--surface); font-weight: 400; font-size: 14px;
}
.modal .field input:focus, .modal .field select:focus { outline: 0; border-color: var(--accent-2); box-shadow: 0 0 0 4px rgba(8, 145, 178, .12); }
.note { font-size: 13px; color: var(--text-3); }
.note.ok { color: var(--good); }
.note.err { color: var(--bad); }
/* ---------- инструменты ---------- */
.section[data-section="tools"] .tele-cards { grid-template-columns: repeat(2, minmax(200px, 260px)); margin-bottom: 18px; }
.section[data-section="tools"] .tele-card { background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); }
.section[data-section="tools"] .tele-card .n { font-size: 30px; }
.tools-list, .tools-planned { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 10px; }
.modal-body .tool-row {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  display: flex; flex-direction: column; gap: 6px;
  opacity: 1;
}
.modal-body .tool-row.planned { background: var(--surface); border-style: dashed; }
.modal-body .tool-name { margin: 0; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; color: var(--text); }
.modal-body .tool-row.planned .tool-name { font-family: inherit; font-size: 14px; }
.modal-body .tool-desc { font-size: 13px; line-height: 1.45; color: var(--text-2); white-space: normal; }
.modal-body .tool-params { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
/* ---------- пользователи ---------- */
.users-list { display: flex; flex-direction: column; gap: 8px; }
.user-row {
  display: grid;
  grid-template-columns: 150px 1fr 120px 100px 110px auto;
  gap: 8px; align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface-2);
}
.user-row.inactive { opacity: .6; }
.user-row .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .who small { display: block; font-weight: 400; color: var(--text-3); font-size: 11px; }
.user-row input, .user-row select {
  width: 100%;
  border: 1px solid var(--line-strong); border-radius: 7px;
  padding: 6px 9px; background: var(--surface); font-size: 13px;
}
.user-row input:focus, .user-row select:focus { outline: 0; border-color: var(--accent-2); }
.user-row .actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.user-row .actions input { width: 150px; }
.user-row .switch { padding: 0; }
.users-empty { color: var(--text-3); font-size: 13px; }
/* ---------- телеметрия ---------- */
.tele-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.tele-card {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface-2); padding: 10px 12px;
}
.tele-card .n { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.tele-card .l { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.tele-stops { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
}
.chip.good { color: var(--good); border-color: #bbf7d0; background: #f0fdf4; }
.chip.bad { color: var(--bad); border-color: #fecaca; background: #fef2f2; }
.chip.warn { color: var(--warn); border-color: #fde68a; background: #fffbeb; }
.tele-list { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-height: 260px; overflow-y: auto; padding-right: 4px; }
.tele-row {
  display: grid; grid-template-columns: 120px 90px 1fr 70px 110px;
  gap: 10px; align-items: center;
  font-size: 13px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface);
}
.tele-row .title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-2); }
.tele-row .sec { font-weight: 700; text-align: right; }
.tele-row .time, .tele-row .who { color: var(--text-3); }
/* ---------- узкие экраны ---------- */
@media (max-width: 760px) {
  .modal { padding: 0; }
  .modal-card { height: 100%; width: 100%; border-radius: 0; grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .modal-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 10px 10px 12px; gap: 6px; }
  .modal-nav-title { display: none; }
  .modal-nav button { white-space: nowrap; box-shadow: none; }
  .modal-nav button.active { box-shadow: none; }
  .modal-body { padding: 18px 16px 20px; }
  .section[data-section="profile"] { display: flex; }
  .section[data-section="tools"] .tele-cards { grid-template-columns: 1fr 1fr; }
  .tools-list, .tools-planned { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .user-row { grid-template-columns: 1fr 1fr; }
  .user-row .actions { grid-column: 1 / -1; }
  .tele-cards { grid-template-columns: 1fr 1fr; }
  .tele-row { grid-template-columns: 1fr 1fr; }
}
