/* =============================================================
   SETTINGS (#view-settings) and the add-machine dialog
   Layout only; components come from form-kit.css.
   ============================================================= */

/* ---------- Device configuration: master / detail ---------- */
.cfg-head { border-bottom: 1px solid var(--hp-border); }

.cfg-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.cfg-master {
  flex: 1 1 300px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--hp-border);
}

.cfg-master__tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 16px 8px;
}

.cfg-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  max-height: 640px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--hp-border-strong) transparent;
}

.cfg-list__empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--hp-text-3);
}

.cfg-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--hp-radius);
  background: transparent;
  color: var(--hp-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cfg-item:hover { background: var(--hp-surface-2); }

.cfg-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--hp-focus);
}

.cfg-item.is-active {
  background: var(--hp-accent-soft);
  border-color: var(--hp-accent);
}

.cfg-item__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.cfg-item__name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cfg-item__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--hp-text-3);
}

.cfg-code {
  width: 36px;
  height: 36px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--hp-radius);
  background: var(--hp-muted-soft);
  color: var(--hp-text-2);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cfg-item.is-active .cfg-code,
.cfg-code--lg {
  background: var(--hp-accent);
  color: var(--hp-accent-fg);
}

.cfg-code--lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

/* Live machine status: colour carries the meaning, the label keeps it readable without colour. */
.cfg-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--hp-text-3);
  white-space: nowrap;
}

.cfg-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.cfg-dot:empty { display: none; }
.cfg-dot--running { color: var(--hp-ok); }
.cfg-dot--stopped { color: var(--hp-warn); }
.cfg-dot--unmonitored::before { background: transparent; border: 1.5px solid currentColor; }

.cfg-detail {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 24px 0;
}

.cfg-detail__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
}

.cfg-detail__title h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--hp-text);
}

.cfg-detail__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.cfg-detail .hp-fs:first-of-type { border-top: 1px solid var(--hp-border); }

.cfg-readonly {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px dashed var(--hp-border-strong);
  border-radius: 10px;
  background: var(--hp-surface-2);
}

.cfg-readonly__icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--hp-radius);
  background: var(--hp-muted-soft);
  color: var(--hp-text-2);
}

.cfg-readonly__icon svg { width: 18px; height: 18px; }

.cfg-readonly__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cfg-readonly__figure {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cfg-readonly__value {
  /* Sized to its figure so the unit sits right after it; 8ch is the fallback width. */
  width: 8ch;
  field-sizing: content;
  min-width: 2ch;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--hp-text);
  font: inherit;
  font-size: 22px;
  font-weight: 700;
  outline: none;
  cursor: default;
  -moz-appearance: textfield;
}

.cfg-readonly__value::-webkit-outer-spin-button,
.cfg-readonly__value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cfg-readonly__unit {
  font-weight: 600;
  color: var(--hp-text-2);
}

/* Save bar stays in reach at the bottom of the screen while the specs are scrolled. */
.cfg-savebar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 -24px;
  padding: 14px 24px;
  border-top: 1px solid var(--hp-border);
  background: var(--hp-surface-2);
  border-radius: 0 0 var(--hp-radius-lg) 0;
}

/* ---------- Accounts ---------- */
.acc-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.acc-page-size {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--hp-text-3);
}

.acc-page-size__select {
  width: auto;
  height: 36px;
}

.acc-search {
  width: 240px;
  max-width: 100%;
}

.acc-col-stt { width: 72px; }
.acc-col-role { width: 220px; }
.acc-col-action { width: 280px; }

.acc-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.acc-avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--hp-muted-soft);
  color: var(--hp-text-2);
  font-size: 12px;
  font-weight: 700;
}

.acc-role-select {
  width: auto;
  min-width: 190px;
  height: 34px;
  font-size: 13px;
  font-weight: 600;
}

.acc-role-select--admin { color: var(--hp-accent-text); }

.acc-actions {
  display: inline-flex;
  gap: 4px;
  justify-content: flex-end;
}

/* ---------- Add-machine dialog ---------- */
.am-card {
  padding: 0;
  width: 700px;
  max-width: 95%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.am-card__head {
  margin-bottom: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hp-border);
}

.am-card__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.am-card__section { margin-top: 4px; }

.hp-modal-card .am-card__foot {
  margin-top: 0;
  padding: 16px 20px;
}

.am-check {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  font-size: 14px;
  color: var(--hp-text);
  cursor: pointer;
}

.am-check input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--hp-accent);
}

.hp-input--password { padding-right: 44px; }
