/* Gestión remota (TR-069). Usa los tokens de styles.css (--panel, --line, --muted, --ok, --warn, --bad). */
#module-tr069 .panel + .panel {
  margin-top: 16px;
}

.tr069-title-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.tr069-title-actions input[type="search"] {
  min-height: 34px;
  min-width: 220px;
}

.tr069-muted {
  color: var(--muted);
}

.tr069-mono {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.tr069-notice {
  background: color-mix(in srgb, var(--warn) 10%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line));
  border-radius: 10px;
  margin: 0 0 12px;
  padding: 10px 14px;
}

.tr069-table {
  width: 100%;
}

.tr069-row {
  cursor: pointer;
}

.tr069-row:hover,
.tr069-row:focus-visible {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  outline: none;
}

.tr069-row.selected {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.tr069-row.unlinked {
  cursor: default;
  opacity: 0.7;
}

.tr069-status {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  white-space: nowrap;
}

.tr069-status.online {
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: var(--ok);
}

.tr069-status.offline {
  background: color-mix(in srgb, var(--muted) 14%, transparent);
  color: var(--muted);
}

.tr069-detail.busy {
  cursor: progress;
}

.tr069-detail .panel-title small {
  display: block;
  margin-top: 2px;
}

.tr069-cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tr069-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px 16px;
}

.tr069-card-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.tr069-card-head h3 {
  margin: 0;
}

.tr069-card-body {
  min-height: 48px;
}

.tr069-error {
  color: var(--bad);
  margin: 0;
}

.tr069-mini {
  min-width: 0; /* styles.css da a toda tabla 560px de mínimo */
  width: 100%;
}

.tr069-mini th {
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  width: 1%;
}

.tr069-wan {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.tr069-wan + .tr069-wan {
  margin-top: 8px;
}

.tr069-wan.internet {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
}

.tr069-wan-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.tr069-wan-head strong {
  overflow-wrap: anywhere;
}

.tr069-tag {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  border-radius: 6px;
  color: var(--primary);
  font-size: 12px;
  padding: 1px 8px;
}

.tr069-wan dl {
  display: grid;
  gap: 4px 12px;
  grid-template-columns: max-content minmax(0, 1fr);
  margin: 0;
}

.tr069-wan dt {
  color: var(--muted);
}

.tr069-wan dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.tr069-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tr069-form .field-block {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.tr069-form input,
.tr069-form select {
  min-width: 0;
  width: 100%;
}

.tr069-form .field-block > span {
  color: var(--muted);
  font-size: 13px;
}

.tr069-form button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 40px;
}

.tr069-warn {
  color: color-mix(in srgb, var(--warn) 80%, var(--text));
}

@media (max-width: 980px) {
  .tr069-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .tr069-title-actions input[type="search"] {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .tr069-form {
    grid-template-columns: minmax(0, 1fr);
  }
}
